I have three layout views for render my web page (one for logged users, other for unlogged users and one for admin users). These layouts have the same footers section. This footer is very complex and I'd like centralizing changes to a single footer view.
How I can add a subview inside the layout view, such that the layout will have the following code for rendering the content returned by actionControler
?
<?php echo $this->content; ?>
And the following code, but this is always same template and isn't returned by the actionController
:
<?php echo $this->footer; ?>
Do I have to modify onBootstrap
method?
If the footer itself is simple you should be able to use the
Zend\View\Helper\Partial
helper to render a phtml file. To do this (inside your layout):If the footer requires some logic, it maybe best to look at creating a view helper.