当前位置: 首页>>代码示例>>PHP>>正文


PHP Validator::boolean方法代码示例

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


在下文中一共展示了Validator::boolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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->boolean('main')->allowEmpty('main');
     $validator->boolean('hidden')->allowEmpty('hidden');
     $validator->requirePresence('name', 'create')->notEmpty('name');
     $validator->integer('lft')->allowEmpty('lft');
     $validator->integer('rght')->allowEmpty('rght');
     return $validator;
 }
开发者ID:randompherret,项目名称:paperbudget,代码行数:16,代码来源:AccountsTable.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->requirePresence('title', 'create')->notEmpty('title');
     $validator->requirePresence('link', 'create')->notEmpty('link');
     $validator->boolean('homepage')->requirePresence('homepage', 'create')->notEmpty('homepage');
     $validator->boolean('state')->requirePresence('state', 'create')->notEmpty('state');
     $validator->integer('lft')->allowEmpty('lft');
     $validator->integer('rght')->allowEmpty('rght');
     $validator->allowEmpty('options');
     return $validator;
 }
开发者ID:mindforce,项目名称:cakephp-front-engine,代码行数:18,代码来源:LinksTable.php

示例3: 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('name', 'create')->notEmpty('name');
     $validator->allowEmpty('value');
     $validator->allowEmpty('description');
     $validator->requirePresence('type', 'create')->notEmpty('type');
     $validator->boolean('editable')->requirePresence('editable', 'create')->notEmpty('editable');
     $validator->integer('weight')->allowEmpty('weight');
     $validator->boolean('autoload')->allowEmpty('autoload');
     return $validator;
 }
开发者ID:crabstudio,项目名称:app,代码行数:18,代码来源:ConfigurationsTable.php

示例4: 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

示例5: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->allowEmpty('language', 'create');
     $validator->boolean('is_official')->requirePresence('is_official', 'create')->notEmpty('is_official');
     $validator->numeric('percentage')->requirePresence('percentage', 'create')->notEmpty('percentage');
     return $validator;
 }
开发者ID:AFPA-Dijon,项目名称:afpa,代码行数:13,代码来源:LanguagesTable.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->requirePresence('message', 'create')->notEmpty('message');
     $validator->boolean('error')->requirePresence('error', 'create')->notEmpty('error');
     return $validator;
 }
开发者ID:PhantomWatson,项目名称:macc,代码行数:13,代码来源:MembershipRenewalLogsTable.php

示例7: 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->numeric('quantity')->allowEmpty('quantity');
     $validator->boolean('load_unload')->allowEmpty('load_unload');
     return $validator;
 }
开发者ID:vorien,项目名称:supplyanddemand,代码行数:13,代码来源:TransfersTable.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->numeric('total')->requirePresence('total', 'create')->notEmpty('total');
     $validator->boolean('paid')->requirePresence('paid', 'create')->notEmpty('paid');
     return $validator;
 }
开发者ID:AdBouli,项目名称:hotel-manager,代码行数:13,代码来源:OrdersTable.php

示例9: validationDefault

 /**
  * Default validation rules.
  *
  * @param \Cake\Validation\Validator $validator Validator instance.
  * @return \Cake\Validation\Validator
  */
 public function validationDefault(Validator $validator)
 {
     $validator->requirePresence('name', 'create')->notEmpty('name');
     $validator->boolean('done')->requirePresence('done', 'create')->notEmpty('done');
     $validator->requirePresence('description', 'create')->notEmpty('description');
     return $validator;
 }
开发者ID:paulohsilvavieira,项目名称:ClientTasks,代码行数:13,代码来源:TasksTable.php

示例10: 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->allowEmpty('label');
     $validator->allowEmpty('url');
     $validator->boolean('new_window')->allowEmpty('new_window');
     return $validator;
 }
开发者ID:QoboLtd,项目名称:cakephp-menu,代码行数:14,代码来源:MenuItemsTable.php

示例11: 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('text', 'create')->notEmpty('text');
     $validator->boolean('sfw')->requirePresence('sfw', 'create')->notEmpty('sfw');
     $validator->integer('status')->requirePresence('status', 'create')->notEmpty('status');
     return $validator;
 }
开发者ID:el-cms,项目名称:elabs,代码行数:14,代码来源:NotesTable.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->boolean('offering_seeking')->requirePresence('offering_seeking', 'create')->notEmpty('offering_seeking');
     $validator->requirePresence('description', 'create')->notEmpty('description');
     $validator->integer('units')->requirePresence('units', 'create')->notEmpty('units');
     $validator->integer('status')->requirePresence('status', 'create')->notEmpty('status');
     return $validator;
 }
开发者ID:LPFP,项目名称:donjon,代码行数:15,代码来源:OffersTable.php

示例13: 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->numeric('quantity')->allowEmpty('quantity');
     $validator->boolean('in_out')->allowEmpty('in_out');
     $validator->numeric('frequency')->allowEmpty('frequency');
     $validator->numeric('value')->allowEmpty('value');
     return $validator;
 }
开发者ID:vorien,项目名称:supplyanddemand,代码行数:15,代码来源:DistributionsTable.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->requirePresence('name', 'create')->notEmpty('name');
     $validator->boolean('income')->allowEmpty('income');
     $validator->allowEmpty('color');
     $validator->numeric('budget')->allowEmpty('budget');
     return $validator;
 }
开发者ID:randompherret,项目名称:paperbudget,代码行数:15,代码来源:CategoriesTable.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->boolean('status')->requirePresence('status', 'create')->notEmpty('status');
     $validator->requirePresence('number', 'create')->add('number', ['length' => ['rule' => ['minLength', 10], 'message' => 'A Turkish phone number should be minimum 10 chars long without 0 at the beginning']])->notEmpty('number');
     $validator->requirePresence('who', 'create')->notEmpty('who');
     $validator->requirePresence('comment', 'create')->notEmpty('comment');
     $validator->allowEmpty('photo');
     return $validator;
 }
开发者ID:midorikocak,项目名称:numbers,代码行数:16,代码来源:NumbersTable.php


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