• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Validation\Validator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Cake\Validation\Validator的典型用法代码示例。如果您正苦于以下问题:PHP Validator类的具体用法?PHP Validator怎么用?PHP Validator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Validator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: 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('username')->add('username', 'validFormat', ['rule' => 'email', 'message' => 'E-mail must be valid']);
     $validator->requirePresence('password', 'create')->notEmpty('password');
     return $validator;
 }
开发者ID:sunilsinh,项目名称:developers,代码行数:13,代码来源:UsersTable.php


示例17: 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('image');
     $validator->allowEmpty('image_dir');
     return $validator;
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:13,代码来源:CategoryDetailsTable.php


示例18: 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('start_place');
     $validator->allowEmpty('end_place');
     return $validator;
 }
开发者ID:jalmonacid,项目名称:austral_glacier_test,代码行数:13,代码来源:ToursTable.php


示例19: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->uuid('id')->allowEmpty('id', 'create');
     $validator->requirePresence('name', 'create')->notEmpty('name');
     $validator->boolean('active')->allowEmpty('active');
     return $validator;
 }
开发者ID:QoboLtd,项目名称:cakephp-menu,代码行数:13,代码来源:MenusTable.php


示例20: 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('created_at', 'valid', ['rule' => 'datetime'])->allowEmpty('created_at');
     $validator->add('updated_at', 'valid', ['rule' => 'datetime'])->allowEmpty('updated_at');
     return $validator;
 }
开发者ID:TeslaDethray,项目名称:AnthosAPI,代码行数:13,代码来源:AttributionsTable.php



注:本文中的Cake\Validation\Validator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP View\Helper类代码示例发布时间:2022-05-23
下一篇:
PHP Utility\Text类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap