本文整理汇总了PHP中Cake\Validation\Validator::email方法的典型用法代码示例。如果您正苦于以下问题:PHP Validator::email方法的具体用法?PHP Validator::email怎么用?PHP Validator::email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Validation\Validator
的用法示例。
在下文中一共展示了Validator::email方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->numeric('id')->allowEmpty('id', 'create');
$validator->requirePresence('name', 'create')->notEmpty('name');
$validator->email('email')->allowEmpty('email')->add('email', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
return $validator;
}
示例2: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->integer('id')->allowEmpty('id', 'create');
$validator->email('email')->requirePresence('email', 'create')->notEmpty('email');
$validator->requirePresence('password', 'create')->notEmpty('password');
return $validator;
}
示例3: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
/*autorise de 4 à 14 caractères de type :
*(a-z) alphanumérique minuscule,
* (A-Z) alphanumérique majuscule,
*(0-9) 0 à 9, (_-) l’underscore et le tiret.
*/
$regexUsername = '/^[a-zA-Z0-9_-]{4,14}$/';
/*autorise de 8 à 12 caractères de type :
*(a-z) alphanumérique minuscule,
*(A-Z) alphanumérique majuscule,
*(0-9) chiffres de 0 à 9,
*(?@.;:!_-) les caractères ? @ . ; : ! _ et -
*/
$regexPassword = ' /^[a-zA-Z0-9?@\\.;:!_-]{8,12}$/';
$validator->integer('id')->allowEmpty('id', 'create');
$validator->requirePresence('username', 'create')->notEmpty('username')->add('username', 'validFormat', ['rule' => ['custom', $regexUsername], 'message' => 'Le nom d\'utilisateur autorise de 8 à 12 caractères de type :
(a-z) alphanumérique minuscule,
(A-Z) alphanumérique majuscule,
(0-9) chiffres de 0 à 9,
(?@.;:!_-) les caractères ? @ . ; : ! _ et - ']);
$validator->requirePresence('password', 'create')->notEmpty('password')->add('password', 'validFormat', ['rule' => ['custom', $regexPassword], 'message' => 'Le mot de passe autorise de 8 à 12 caractères de type :
(a-z) alphanumérique minuscule,
(A-Z) alphanumérique majuscule,
(0-9) chiffres de 0 à 9,
(?@.;:!_-) les caractères ? @ . ; : ! _ et - ']);
$validator->requirePresence('first_name', 'create')->notEmpty('first_name');
$validator->requirePresence('last_name', 'create')->notEmpty('last_name');
$validator->email('email')->requirePresence('email', 'create')->notEmpty('email');
return $validator;
}
示例4: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->numeric('id')->allowEmpty('id', 'create');
$validator->allowEmpty('name');
$validator->email('email')->allowEmpty('email');
$validator->allowEmpty('password');
return $validator;
}
示例5: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->integer('id')->allowEmpty('id', 'create');
$validator->requirePresence('username', 'create')->notEmpty('username', 'A username is required.')->add('username', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
$validator->email('email')->requirePresence('email', 'create')->notEmpty('email')->add('email', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
$validator->requirePresence('password', 'create')->notEmpty('password', 'A password is required.');
$validator->notEmpty('role', 'A role is required.')->add('role', 'inList', ['rule' => ['inList', ['Admin', 'User']], 'message' => 'Please enter a valid role.']);
return $validator;
}
示例6: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->integer('id')->allowEmpty('id', 'create');
$validator->allowEmpty('first_name');
$validator->allowEmpty('last_name');
$validator->email('email')->allowEmpty('email');
$validator->allowEmpty('picture');
$validator->integer('max_score')->allowEmpty('max_score');
return $validator;
}
示例7: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->integer('id')->allowEmpty('id', 'create');
$validator->allowEmpty('name');
$validator->email('email')->allowEmpty('email');
$validator->requirePresence('url', 'create')->notEmpty('url');
$validator->requirePresence('reason', 'create')->notEmpty('reason');
$validator->allowEmpty('session');
return $validator;
}
示例8: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->integer('id')->allowEmpty('id', 'create');
$validator->requirePresence('lastName', 'create')->notEmpty('lastName');
$validator->requirePresence('firstName', 'create')->notEmpty('firstName');
$validator->email('email')->requirePresence('email', 'create')->notEmpty('email');
$validator->requirePresence('phone', 'create')->notEmpty('phone');
$validator->requirePresence('address', 'create')->notEmpty('address');
return $validator;
}
示例9: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->integer('id')->allowEmpty('id', 'create');
$validator->requirePresence('model', 'create')->notEmpty('model');
$validator->uuid('fkid')->requirePresence('fkid', 'create')->notEmpty('fkid');
$validator->requirePresence('name', 'create')->notEmpty('name');
$validator->email('email')->requirePresence('email', 'create')->notEmpty('email');
$validator->boolean('allow_contact')->requirePresence('allow_contact', 'create')->notEmpty('allow_contact');
$validator->requirePresence('message', 'create')->notEmpty('message');
return $validator;
}
示例10: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->integer('id')->allowEmpty('id', 'create');
$validator->requirePresence('password', 'create')->notEmpty('password');
$validator->email('email')->requirePresence('email', 'create')->notEmpty('email');
$validator->requirePresence('role', 'create')->notEmpty('role');
$validator->requirePresence('nom', 'create')->notEmpty('nom');
$validator->requirePresence('prenom', 'create')->notEmpty('prenom');
$validator->requirePresence('adresse', 'create')->notEmpty('adresse');
$validator->integer('codepostal')->requirePresence('codepostal', 'create')->notEmpty('codepostal');
$validator->requirePresence('ville', 'create')->notEmpty('ville');
return $validator;
}
示例11: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->integer('id')->allowEmpty('id', 'create');
$validator->integer('role')->requirePresence('role', 'create')->notEmpty('role');
$validator->integer('name')->requirePresence('name', 'create')->notEmpty('name');
$validator->integer('firstname')->requirePresence('firstname', 'create')->notEmpty('firstname');
$validator->email('email')->requirePresence('email', 'create')->notEmpty('email');
$validator->requirePresence('password', 'create')->notEmpty('password');
$validator->requirePresence('poste', 'create')->notEmpty('poste');
$validator->requirePresence('numberSS', 'create')->notEmpty('numberSS');
$validator->requirePresence('numberFisc', 'create')->notEmpty('numberFisc');
return $validator;
}
示例12: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->integer('id')->allowEmpty('id', 'create');
$validator->requirePresence('nombre', 'create')->notEmpty('nombre');
$validator->requirePresence('apellido', 'create')->notEmpty('apellido');
$validator->requirePresence('password', 'create')->notEmpty('password');
$validator->date('fecha_nacimiento')->requirePresence('fecha_nacimiento', 'create')->notEmpty('fecha_nacimiento');
$validator->email('email')->requirePresence('email', 'create')->notEmpty('email');
$validator->requirePresence('telefono', 'create')->notEmpty('telefono');
$validator->integer('num_natricula')->requirePresence('num_natricula', 'create')->notEmpty('num_natricula');
$validator->decimal('nota_selectividad')->requirePresence('nota_selectividad', 'create')->notEmpty('nota_selectividad');
return $validator;
}
示例13: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->integer('id')->allowEmpty('id', 'create');
$validator->requirePresence('nome', 'create')->notEmpty('nome');
$validator->requirePresence('username', 'create')->notEmpty('username')->add('username', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
$validator->requirePresence('password', 'create')->notEmpty('password');
$validator->requirePresence('matricula', 'create')->notEmpty('matricula')->add('matricula', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
$validator->email('email')->requirePresence('email', 'create')->notEmpty('email')->add('email', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
$validator->requirePresence('role', 'create')->notEmpty('role');
$validator->allowEmpty('cadastradoPor');
$validator->dateTime('dataDeCadastro');
$validator->dateTime('ultimaVezAtivo');
return $validator;
}
示例14: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->integer('id')->allowEmpty('id', 'create');
$validator->email('email')->requirePresence('email', 'create')->notEmpty('email');
$validator->requirePresence('password', 'create')->notEmpty('password');
$validator->allowEmpty('image');
$validator->allowEmpty('group_id');
$validator->allowEmpty('image_dir');
$validator->requirePresence('dob', 'create')->notEmpty('dob');
$validator->requirePresence('mobile', 'create')->notEmpty('mobile');
$validator->requirePresence('firstname', 'create')->notEmpty('firstname');
$validator->requirePresence('lastname', 'create')->notEmpty('lastname');
return $validator;
}
示例15: validationDefault
/**
* Default validation rules.
*
* @param \Cake\Validation\Validator $validator Validator instance.
* @return \Cake\Validation\Validator
*/
public function validationDefault(Validator $validator)
{
$validator->integer('id')->allowEmpty('id', 'create');
$validator->requirePresence('firstname', 'create')->notEmpty('firstname');
$validator->requirePresence('lastname', 'create')->notEmpty('lastname');
$validator->email('email')->requirePresence('email', 'create')->notEmpty('email');
$validator->requirePresence('street_address', 'create')->notEmpty('street_address');
$validator->requirePresence('city', 'create')->notEmpty('city');
$validator->requirePresence('country', 'create')->notEmpty('country');
$validator->requirePresence('pincode', 'create')->notEmpty('pincode');
$validator->requirePresence('phone', 'create')->notEmpty('phone');
$validator->requirePresence('mobile', 'create')->notEmpty('mobile');
return $validator;
}