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


PHP Validation\Validator類代碼示例

本文整理匯總了PHP中Cake\Validation\Validator的典型用法代碼示例。如果您正苦於以下問題:PHP Validator類的具體用法?PHP Validator怎麽用?PHP Validator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Validator類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->add('id', 'valid', ['rule' => 'numeric'])->allowEmpty('id', 'create');
     $validator->requirePresence('intern_code', 'create')->notEmpty('intern_code')->add('intern_code', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
     $validator->requirePresence('feature_name', 'create')->notEmpty('feature_name')->add('feature_name', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
     return $validator;
 }
開發者ID:ricardohenriq,項目名稱:shooping,代碼行數:13,代碼來源:FeaturesTable.php

示例2: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->add('ID', 'valid', ['rule' => 'numeric'])->allowEmpty('ID', 'create');
     $validator->requirePresence('LOGIN', 'create')->notEmpty('LOGIN');
     $validator->requirePresence('PASSWORD', 'create')->notEmpty('PASSWORD');
     return $validator;
 }
開發者ID:Terrtia,項目名稱:Qwinto,代碼行數:13,代碼來源:UsersTable.php

示例3: _buildValidator

 protected function _buildValidator(Validator $validator)
 {
     $validator->allowEmpty('cubs');
     $validator->allowEmpty('yls');
     $validator->allowEmpty('leaders');
     return $validator;
 }
開發者ID:CubScoutCake,項目名稱:CubEventBooking,代碼行數:7,代碼來源:InvForm.php

示例4: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->allowEmpty('id', 'create');
     $validator->requirePresence('name', 'create')->notEmpty('name');
     $validator->requirePresence('description', 'create')->notEmpty('description');
     return $validator;
 }
開發者ID:Multicoin-co,項目名稱:PHP-WebStore,代碼行數:13,代碼來源:ProductTypeTable.php

示例5: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->allowEmpty('id', 'create')->add('id', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
     $validator->requirePresence('uuid', 'create')->notEmpty('uuid');
     $validator->numeric('value')->requirePresence('value', 'create')->notEmpty('value');
     return $validator;
 }
開發者ID:MoosemanStudios,項目名稱:api.moosecraft.us,代碼行數:13,代碼來源:StatsJoinsTable.php

示例6: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->add('id', 'valid', ['rule' => 'numeric'])->allowEmpty('id', 'create');
     $validator->requirePresence('first_name', 'create')->notEmpty('first_name', 'First name must be required!');
     $validator->requirePresence('last_name', 'create')->notEmpty('last_name', 'Last name must be required!');
     return $validator;
 }
開發者ID:sohelrana820,項目名稱:bookmark,代碼行數:13,代碼來源:ProfilesTable.php

示例7: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->add('id', 'valid', ['rule' => 'numeric'])->allowEmpty('id', 'create');
     $validator->add('email', 'valid', ['rule' => 'email'])->requirePresence('email', 'create')->notEmpty('email');
     $validator->requirePresence('password', 'create')->notEmpty('password');
     return $validator;
 }
開發者ID:Kaju-Bubanja,項目名稱:GSOA,代碼行數:13,代碼來源:UsersTable.php

示例8: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->add('id', 'valid', ['rule' => 'numeric'])->allowEmpty('member_roleId', 'create');
     $validator->add('memberId', 'valid', ['rule' => 'numeric'])->requirePresence('memberId', 'create')->notEmpty('memberId');
     $validator->add('roleId', 'valid', ['rule' => 'numeric'])->requirePresence('roleId', 'create')->notEmpty('roleId');
     return $validator;
 }
開發者ID:ahsankhan201,項目名稱:trade,代碼行數:13,代碼來源:MemberRolesTable.php

示例9: _buildValidator

 protected function _buildValidator(Validator $validator)
 {
     $validator->requirePresence('cubs', 'create');
     $validator->requirePresence('yls', 'create');
     $validator->requirePresence('leaders', 'create');
     return $validator;
 }
開發者ID:CubScoutCake,項目名稱:CubEventBooking,代碼行數:7,代碼來源:InvGenForm.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->email('email')->requirePresence('email', 'create')->notEmpty('email');
     $validator->requirePresence('password', 'create')->notEmpty('password');
     return $validator;
 }
開發者ID:nevermore2014,項目名稱:bookmark,代碼行數:13,代碼來源:UsersTable.php

示例11: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->add('id', 'valid', ['rule' => 'numeric'])->allowEmpty('id', 'create');
     $validator->allowEmpty('opestado');
     $validator->add('order', 'valid', ['rule' => 'numeric'])->allowEmpty('order')->add('order', 'unique', ['rule' => 'validateUnique', 'provider' => 'table']);
     return $validator;
 }
開發者ID:edgarmirandasilva,項目名稱:CAKECRM,代碼行數:13,代碼來源:OpestadoTable.php

示例12: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->add('id', 'valid', ['rule' => 'numeric'])->allowEmpty('id', 'create');
     $validator->add('user_requesting', 'valid', ['rule' => 'numeric'])->allowEmpty('user_requesting', 'create');
     $validator->add('user_requested', 'valid', ['rule' => 'numeric'])->allowEmpty('user_requested', 'create');
     return $validator;
 }
開發者ID:hengling,項目名稱:MealAdvisor,代碼行數:13,代碼來源:FriendRequestsTable.php

示例13: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->add('id', 'valid', ['rule' => 'numeric'])->allowEmpty('id', 'create');
     $validator->requirePresence('custom_message', 'create')->notEmpty('custom_message');
     $validator->add('date_applied', 'valid', ['rule' => 'datetime'])->requirePresence('date_applied', 'create')->notEmpty('date_applied');
     return $validator;
 }
開發者ID:joelfrens,項目名稱:rytskil,代碼行數:13,代碼來源:JobApplicationsTable.php

示例14: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->requirePresence('nombre', 'create')->notEmpty('nombre');
     $validator->add('nro_integrantes', 'valid', ['rule' => 'numeric'])->allowEmpty('nro_integrantes');
     $validator->add('id', 'valid', ['rule' => 'numeric'])->allowEmpty('id', 'create');
     return $validator;
 }
開發者ID:gzuzkstro,項目名稱:sportevent1,代碼行數:13,代碼來源:TeamsTable.php

示例15: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->allowEmpty('title', 'create');
     $validator->add('from_date', 'valid', ['rule' => 'date'])->allowEmpty('from_date', 'create');
     $validator->add('to_date', 'valid', ['rule' => 'date'])->allowEmpty('to_date');
     return $validator;
 }
開發者ID:surjit,項目名稱:cakephp3-advanced-examples,代碼行數:13,代碼來源:TitlesTable.php


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