The view scripts can be very dynamic but most of the time we need a global template that we want to wrap around the output from our
Action view scripts. This recipe will explain exactly how to do that, and also tells us how that would work.
For this recipe a working Zend Framework 2 skeleton application is needed as we will do some creating and editing of some files which are used in there.
The following is how we set about achieving this:
Let's now create the main file
/module/Application/view/layout/layout.phtml we use to create our layout:
<!-- first of all we want to output the doctype --> <?php echo $this->doctype(); ?> <!-- now we add the HTML tag --> <html> ...