本文整理汇总了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;
}
示例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;
}
示例3: _buildValidator
protected function _buildValidator(Validator $validator)
{
$validator->allowEmpty('cubs');
$validator->allowEmpty('yls');
$validator->allowEmpty('leaders');
return $validator;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例9: _buildValidator
protected function _buildValidator(Validator $validator)
{
$validator->requirePresence('cubs', 'create');
$validator->requirePresence('yls', 'create');
$validator->requirePresence('leaders', 'create');
return $validator;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}