Chapter 4. Managing the view
This chapter covers
- Understanding the Composite View design pattern
- Using the Zend_Layout component
- Building a front controller plug-in to initialize the view
- Creating cleaner scripts by using view helpers
In Chapter 3, we created a project, the Places to take the kids! website, that will showcase features of Zend Framework over the course of this book, and will demonstrate how to integrate components into a proper web application. We have looked at the directory structure, creating a model and a controller for the home page, and also at how to test these. To complete the first stage of the website, we now need to create view scripts.
The view is the section of your application that the user interacts with, so it is important that you get it right. All but the smallest of websites have common display elements on all pages. Usually this includes the header, footer, and navigation elements, but it could also include advertising banners and other elements required by the site’s design. Zend Framework provides a suite of components that help make the visual part of your website both powerful and flexible and also easy to maintain in the long term.