Now I do this:
public function indexAction() { ... $view = new ViewModel(array( 'foo' => 'bar', )); return $view; }
The problem is that I want to do something after rendering $ view and before rendering the layout:
public function indexAction() { ... $view = new ViewModel(array( 'foo' => 'bar', )); $layout = $this->layout(); $layout->content = $view->render(); ...
But there is no render () method. In ZF1, I could visualize the view:
$view = new Zend_View($data); $html = $view->render($templateName);
How to do it in ZF2?
Ildar source share