I have a controller that passes input from a form into a model class to perform validation. If the validation is successful I want to allow the flow to continue and render the default view associated with the controller.
My issue is that if validation is not successful then I want the model to pass back validation error messages and display them in a separate view. How can I set the error messages on the alternative view?
Thanks in advance.
Well, from the controller you can redirect them to another action in another controller:
$this->_forward($newactionname,
$newcontrollername,
$newmodulename,
Array($parameters_to_pass);
}
or you just just render a different view file:
$this->render('index_alternative');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With