A custom resource plugin for populating the registry
Saturday, August 14, 2010

This post looks at a simple custom resource plugin that I’ve recently created for populating the registry with values from the application configuration file. I have already examined adding a Log plugin and a View plugin in previous posts; the basic technique for adding this one is the same. (more…)

Posted by James at 4:21 pm   1 comment

Creating a Datestamped Log File using the Standard Log Resource Plugin
Wednesday, March 10, 2010

In a previous post, I looked at creating a custom resource plugin to create a logger. Since I wrote that code, a standard resource plugin to perform this function has been created. At first sight the standard plugin is inferior, in that the custom plugin allows for the insertion of a date into the log filename, which allows a new log to be created every day, while the standard plugin requires a fixed filename specified in the configuration file. However, I have worked out a simple mechanism for adding a date stamp to the filename, which I shall share in this article. (more…)

Posted by James at 11:40 pm   0 comments

Bootstrapping the Application: the Bootstrap Class
Thursday, October 1, 2009

In addition to initialising application components via resource plugins. it is also possible to do so via the bootstrap class itself. (more…)

Posted by James at 6:31 pm   0 comments

Bootstrapping the Application: a Custom View Resource Plugin
Wednesday, September 30, 2009

As well as writing a completely new resource plugin to use with Zend_Application, it is also possible to write a plugin that replaces one of the standard ones. The reason for doing this is that the existing plugins sometimes don’t do all the things that you want them to. (more…)

Posted by James at 12:02 am   0 comments

Bootstrapping the Application: a Custom Log Resource Plugin
Monday, September 28, 2009

So far, we have been looking at how to use several of the standard resource plugins that come with Zend_Application in order to initialise application resources. It is possible, indeed encouraged, to create your own custom resource plugins to handle the initialisation of resources that fall outside their scope. (more…)

Posted by James at 9:57 am   1 comment

Bootstrapping the Application: the Standard Router Resource Plugin
Sunday, September 27, 2009

The Zend Framework uses the Zend_Controller_Router_Rewrite class to decompose requests into module/controller/action/parameters, which are then despatched to the appropriate class for handling. It is possible to attach some custom handling to the router to allow for special handling of certain requests. For instance, you may want to allow Google to retrieve your sitemap via a request for http://www.example.com/sitemap.xml. The router allows this to be converted into a request for a particular combination of module/controller/action/parameters, which can then be handled in the usual way. E.g. the above request might be treated as equivalent to http://www.example.com/default/sitemap/index. (more…)

Posted by James at 2:03 pm   0 comments

Bootstrapping the Application: the Standard Navigation Resource Plugin
Saturday, September 26, 2009

Zend_Navigation is a Zend Framework component used to represent the pages on a web site and transform this into things such as page navigation and Google sitemaps. The standard navigation resource plugin Zend_Application_Resource_Navigation can be used to configure an instance of Zend_Navigation. (more…)

Posted by James at 3:10 pm   0 comments

Bootstrapping the Application: the Standard Layout Resource Plugin
Friday, September 25, 2009

The Zend Framework offers a template module called Zend_Layout. This is primarily used to render the standard parts of a web page, such as the header, sidebars and footer, and to insert the variable content into placeholders. However, it can also be used to render other things with standard layouts, such as e-mails. We shall have a look at examples of both in later posts. (more…)

Posted by James at 3:07 pm   0 comments

Bootstrapping the Application: the Standard Front Controller Resource Plugin
Thursday, September 24, 2009

The Zend Framework uses the front controller pattern. This involves all requests being channeled via a single object. To make use of the front controller you need to create an instance of Zend_Controller_Front and run it. Zend_Application automates this process. (more…)

Posted by James at 8:35 pm   0 comments

Bootstrapping the Application: the Standard Database Resource Plugin
Wednesday, September 23, 2009

The configuration of the standard database resource plugin Zend_Application_Resource_Db can be done easily via the configuration file. The following code (with sensitive settings hidden) shows how to set up the database adapter: (more…)

Posted by James at 4:29 pm   0 comments
Next Page »