Bootstrapping the Application: Resource Plugin Overview
Monday, September 21, 2009
The bootstrapping process supported by Zend_Application is based on a system of resource plugins. Each of these plugins is responsible for initialising an aspect of the system. There are a number of standard plugins already implemented; it is also possible to create your own, either to support something new, or to override an existing plugin. There are examples of each of these in the sample application.
To add a resource plugin to the application, you need to declare it in the configuration file. Each plugin must be a member of the resources array, and any settings for the plugin must be members of the plugins array. If the plugin has no options, it should still be declared as an empty array.
For instance, to add the view resource plugin with the default options set, you should add the following line to the configuration file:
resources.view[] =
However, if you want to add it and set some of the options yourself, you need to add a line for each option; e.g. the following sets the encoding type for the view to UTF-8:
resources.view.encoding = "UTF-8"
The application makes use of the following standard resource plugins:
- Zend_Application_Resource_Db (db)
- Zend_Application_Resource_Frontcontroller (frontController)
- Zend_Application_Resource_Layout (layout)
- Zend_Application_Resource_Navigation (navigation)
- Zend_Application_Resource_Router (router)
The application makes use of the following custom resource plugins:
- Default_Resource_Log (log)
- Default_Resource_View (view)
Note that the custom plugin Default_Resource_View overrides the standard plugin Zend_Application_Resource_View.
I shall look at these plugins in turn in the next few posts.

Practical Web 2.0 Applications with PHP (Expert's Voice) by Quentin Zervaas
Beginning Databases with PostreSQL: From Expert to Professional 2nd Edition: From Novice to Professional by Neil Matthew, Richard Stones