Skip to content

Instantly share code, notes, and snippets.

@igniteflow
Created October 14, 2010 10:56
Show Gist options
  • Save igniteflow/626018 to your computer and use it in GitHub Desktop.
Save igniteflow/626018 to your computer and use it in GitHub Desktop.
/*
* 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