Skip to content

Instantly share code, notes, and snippets.

@rnsk
Last active December 31, 2015 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rnsk/8030293 to your computer and use it in GitHub Desktop.
Save rnsk/8030293 to your computer and use it in GitHub Desktop.
/**
* Validation rules
*
* @var array
*/
public $validate = array(
'email' => array(
'email' => array(
'rule' => 'email',
'required' => false,
'allowEmtpy' => true,
'on' => null,
'message' => 'メールアドレスの形式が間違っています。',
'last' => true
)
)
);
/**
* email validation method
*
* A verification rule is overwritten.
*/
public function email($check, $deep = false, $regex = null)
{
foreach ($check as $value) {
if (empty($value)) {
return true;
}
return Validation::email($value, $deep, $regex);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment