Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zend different view scripts?

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.

like image 761
db83 Avatar asked Aug 13 '09 13:08

db83


1 Answers

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');
like image 130
Richy B. Avatar answered Sep 21 '22 06:09

Richy B.