[eluser]Yoshiyuki Mikome[/eluser]
Hi, everyone.
I have some array fields and I wish validate them using form_validation.
However, Codeigniter is only to return the following message, I can not know that an error in the position in the array.
Code:
$error["fieldname[]"] = "message"
So, I use My_Form_validation modified as follows.
Code:
if ( ! isset($this->_error_array[$row['field']]))
{
if ($row['is_array'])
{
eval('$this->_error_array["'.join('"]["', $row['keys']).'"][$cycles] = $message;');
}
else
{
$this->_error_array[$row['field']] = $message;
}
}
return;
I want to avoid copying of large functions, such as _excecute.
Are there any other good ideas?