當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Validator::email方法代碼示例

本文整理匯總了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;
 }
開發者ID:ionas,項目名稱:bake,代碼行數:13,代碼來源:testBakeTableValidation.php

示例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;
 }
開發者ID:nevermore2014,項目名稱:bookmark,代碼行數:13,代碼來源:UsersTable.php

示例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;
 }
開發者ID:AFPA-Dijon,項目名稱:afpa,代碼行數:37,代碼來源:UsersTable.php

示例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;
 }
開發者ID:vorien,項目名稱:supplyanddemand,代碼行數:14,代碼來源:UsersTable.php

示例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;
 }
開發者ID:Custodia,項目名稱:caketickets,代碼行數:15,代碼來源:UsersTable.php

示例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;
 }
開發者ID:albertoneto,項目名稱:localhost,代碼行數:16,代碼來源:UsersTable.php

示例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;
 }
開發者ID:el-cms,項目名稱:elabs,代碼行數:16,代碼來源:ReportsTable.php

示例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;
 }
開發者ID:AdBouli,項目名稱:hotel-manager,代碼行數:16,代碼來源:AccountsTable.php

示例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;
 }
開發者ID:el-cms,項目名稱:elabs,代碼行數:17,代碼來源:CommentsTable.php

示例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;
 }
開發者ID:AFPA-Dijon,項目名稱:afpa,代碼行數:19,代碼來源:UsersTable.php

示例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;
 }
開發者ID:Nadia78,項目名稱:easyhr,代碼行數:19,代碼來源:UsersTable.php

示例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;
 }
開發者ID:srubengt,項目名稱:cakephp,代碼行數:19,代碼來源:AlumnosTable.php

示例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;
 }
開發者ID:daniels85,項目名稱:SGL,代碼行數:20,代碼來源:UsersTable.php

示例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;
 }
開發者ID:rashmi,項目名稱:newrepo,代碼行數:20,代碼來源:AdminsTable.php

示例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;
 }
開發者ID:rashmi,項目名稱:newrepo,代碼行數:20,代碼來源:OrderShippingsTable.php


注:本文中的Cake\Validation\Validator::email方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。