Welcome Guest, Not a member yet? Register   Sign In
Form validation rules in a config file
#1

[eluser]ChrisHJ[/eluser]
Hi,
i have all my validation rules in a config file.
But i discovered that the rules doesnt work if i pass a var to the controller function that uses the validation rules.

Example:
Code:
Controller:
function foo($var)
{
run validation
}

Valdation config file:
'controller_name/foo' => array(
array(
'field' => 'input_name',
'label' => 'Input',
'rules' => 'required'
)

It works when setting the rules directly in the controller function...
Anybody knows how to work around this ?

Regards Chris.
#2

[eluser]dottedquad[/eluser]
Try placing the functions into the config file.




Theme © iAndrew 2016 - Forum software by © MyBB