當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。