Pro PHP- Patterns, Frameworks, Testing and More

(vip2019) #1
259

■ ■ ■


CHAPTER 17


The Zend Framework Applied


In the previous chapters, you’ve seen a glimpse of some of the Zend Framework components
and how to use them in your applications. In this chapter, you will get a better understanding
of the Zend Framework’s architecture, dispatch cycle, and plug-in architecture. You will also
learn how to create your own reusable libraries and integrate them with Zend_Loader.
Near the end of this chapter, you will apply your knowledge and create a fully integrated
authorization and access control system. Finally, you will learn about the Zend_Layout compo-
nent, which allows you to create a site with a common look and feel throughout. After reading
this chapter, you should have a sound understanding of how the Zend Framework works.

Module and Model Setup


In the previous chapters, you have created Zend Framework sites that follow a single controller/
action hierarchy. This is typically all that is needed, but if you have a complex site, a third level
can be added. This third level is called a module and allows you to build URLs that follow the
/module/controller/action format.

Conventional Modular Directory Structure


This URL structure and its underlying framework layout are commonly known as the Conven-
tional Modular Directory Structure. When working with a modular setup, your directory structure
may look like Listing 17-1, assuming you have the two modules default and admin.

Listing 17-1. A Modular Directory Structure

.
./application
./application/modules
./application/modules/default
./application/modules/default/controllers
./application/modules/default/views
./application/modules/default/views/scripts
./application/modules/default/views/scripts/index
./application/modules/default/views/scripts/error
./application/modules/default/models
./application/modules/admin

McArthur_819-9.book Page 259 Friday, February 29, 2008 8:03 AM

Free download pdf