11-18-2017, 07:32 PM
Introducing a new rule: 'in'.
In, function 'check':
<pre></pre>
In user file, validation array:
<pre></pre>
In
Code:
Validate.php
<pre>
Code:
case 'in':
if (!in_array($value, $rule_value)) {
$this->addError(["{$display} has to be one of these: ".implode($rule_value, ','),$item]);
}
break;
In user file, validation array:
<pre>
Code:
'gender' => array(
'display' => 'Gender',
'required' => true,
'in' => array('m','f')
)