本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}