Created
October 14, 2010 10:56
-
-
Save igniteflow/626018 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* CakePHP Model Snippet | |
* Validates an email address and checks that it doesn't already exist in the database | |
*/ | |
var $validate = array( | |
'email' => array( | |
'form' => array( | |
'rule' => 'email', | |
'message' => 'Please enter a valid email address', | |
'allowEmpty' => false, | |
'last' => true | |
), | |
'unique' => array( | |
'rule' => 'isUnique', | |
'message' => 'You are already registered', | |
'allowEmpty' => false, | |
'last' => true | |
), | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment