Hi,
Anyone knows why the documentation says that $rules can be an array of rules?
add_field($name, $label, $rules)
$rules mixed
None
The set of validation rules with (optional) rule parameters grouped in square brackets, and separated with commas. It can be passed as a string where the rules are separated with a vertical bar or pipe symbol (|), or as a array of rules.
http://docs.fuelphp.com/classes/validation/methods.html
But in my version of fuel (1.0/1.1), this method starts like this:
/**
* Simpler alias for Validation->add()
*
* @param string Field name
* @param string Field label
* @param string Rules as a piped string
* @return Fieldset_Field $this to allow chaining
*/
public function add_field($name, $label, $rules)
{
$field = $this->add($name, $label);
$rules = explode('|', $rules);
foreach ($rules as $rule)
So clearly that's never gonna accept an array as $rule.
Thanks,
Jakob
The docs reflect the latest released version, which at the moment is 1.2RC1.
This is obviously a feature that has been introduced in 1.2, and is not present in 1.1.