O'Reilly logo

Zend Framework 2 Cookbook by Josephus Callaars

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with View

View can be considered very important as it actually renders the content that is being outputted to the browser of the user. Therefore, we can assume that knowing how View works is very useful when creating web applications.

Getting ready

For this recipe it is beneficial if we have the Zend Framework 2 skeleton set up and ready to work. We will do some basic things to get you started, so no additional extensions are necessary for this.

How to do it…

We are going to output content to the browser by using PhpRenderer which is the default view strategy used.

Configure the ViewManager

We make the following alterations to the /module/Application/config/module.config.php file:

<?php return array( 'view_manager' =>array( // We want to show ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required