Hi,
I need help to understand how fuelphp works with template and returned values.
I have a form in a view that send two fields to a function of my controller.
I put a validation object in it and I have a strange behavior.
Actually when the validation is ok I can return true but when it is not, I try to return false but the controller is trying diplay the template.
He is my code
if (\Fuel\Core\Input::post())
{
//$val = Validation::forge('my_validation');
$val = Validation::forge('my_validation');
$val->add_field('emailAdress','' , 'required');
$val->add_field('password', '', 'required|min_length[3]|max_length[10]');
if ($val->run())
{
//var_dump($val->validated());
//var_dump($val->input());
return true;
}
else
{
//var_dump($val->input());
//var_dump($val->error());
return false;
}
}
I need to understand. please help.
Thank you in advance
Hi,
Thank you very much for your answer, it helped a lot ! From there and with the documentation I have been able to understand what I was doing wring.
Thanks again :)
It looks like you're new here. If you want to get involved, click one of these buttons!