Simple Access Control
Friday, January 28, 2011

In my previous post, I looked at using a controller plugin as part of a more complex access control system based on an access control list. However, sometimes a simpler solution makes sense. For instance, in a recent project, I just needed to restrict access to the admin section of the site. The admin section was contained within the admin module. I therefore need to check only two things:

  1. Was the user trying to access something in the admin section?
  2. Was the user logged in as admin?

I still needed to add the mechanism for logging in, but there was no need for an access control list, and the implementation of the Access Control Plugin was much simpler. (more…)

Posted by James at 7:26 pm   0 comments

The Access Control Plugin
Wednesday, December 8, 2010

This post deals with the last piece of the access control/authentication jigsaw: the Access Control plugin. It shows how an application can makes use of the Zend Framework’s controller plugin mechanism to apply the access control list to a user request. (more…)

Posted by James at 8:28 pm   5 comments

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   2 comments

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   2 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
Next Page »