I would like to include multiple views within a view in ZF2. I read this link: http://framework.zend.com/manual/current/en/modules/zend.view.quick-start.html
but there is a problem. In this way, I have to pass the values that are within a view, like this:
$secondView = new ViewModel (array('var1' => $var1 ......));
In this mode the controller and second action are bypassed. Is there a way to include a view without bypassing them? I would like variables to be passed from the second action controller, like an include php statement
If I understood correctly your question, I think that what you're asking is not possible.
My suggestion would be to move the retrieval of the data you need for the secondView somewhere else, away from the controller, and call it both from the second controller and form the first controller to pass them to the secondView.
If you really want to go on with your approach, the only possibility I see is to use javascript and ajax calls to retrieve the partials you need in your view