Yii 1.1: advancedemailvalidator

An Email validator which checks for a valid top-level-domain

This extension is a small modification of the original CEmailValidator class. I've build in a top-level-domain check based on the offical list available here.




  • Yii 1.0 or above


  • Extract the release file under protected/extensions


Check examples in The Definitive Guide to Yii

Things to mention

Since the top-level-domains will get fetched from an external source, you have to define a cache component in the config in order to use this extension. cacheID defaults to "cache".

The tld's will get cached for 24 hours. If they couldn't get fetched from iana.org for some reason, we use a fallback pattern to validate an email address. This fallback pattern works basically like the one from the original CEmailValidator class. It will get cached for 1 hour - we don't want to flood iana.org =)

I have removed the fullPattern and allowName attributes from the original class since I've not get it to work properly.

I may update this extension from time to time for some enhancements.

Change Log

January 6, 2010

  • Initial release.

Be the first person to leave a comment

Please to leave your comment.

Create extension
  • Yii Version: 1.1
  • License: Other Open Source License
  • Developed by: Y!!
  • Category: Validation
  • Votes: No votes yet
  • Downloaded: 608 times
  • Created on: Jan 6, 2010
  • Last updated: Jan 6, 2010