Tuesday, August 28, 2012

Understanding Zend Framework’s Plugin: Resource Plugin...(Part Three)

This post on Resource Plugin would be the last in the series of posts on Plugins as we have it in Zend Framework that I started a couple of weeks back. The previous two posts were on Simple Class/Front Controller Plugin and Controller Action Helper and View helpers.

Resource Plugin are tied to bootstrapping process in Zend Framework. In order to get a good understanding of Resource Plugins, it would be good to first of all take a step back and have an overview of what Bootstrapping means in Zend Framework’s context. This would help in getting a better understanding of what actually goes on when we say we want to make use of or write our own Resource plugins.

So what exactly is Bootstrapping?

Whenever a Zend Framework application is accessed, the following process must occur in order for the application to run and respond to a request. These processes occur in the order that they are listed below:

1.Application Bootstrapping: This is the process of preparing the application and making sure things needed to run it are available: setting up application environment etc.

2.URL Routing: Process of getting the URL and determining the respective Modules, Controller, Action that is being referred to in the application.

3.Dispatch: This is actually the process of initiating and calling the necessary controller and action from the specified module (if module is specified)

Sunday, August 05, 2012

Understanding Zend Framework’s Plugin: Controller Action Helper Plugin, and View Helper...(Part Two)

Last week I started off with the first post in a series of post on plugins as you have in Zend Framework. This is the second part of the series, where I would look at Zend framework’s Controller Action Helper and View Helper, since the previous post covered Simple Class plugin and Front Controller plugin - you can read it here.
As I said in my previous post, the idea behind these series of posts is to shed some light on plugins and the different incarnation that exists within Zend framework;


Controller Action Helper

First let me start by explicitly saying that Controller Action Helper and Front Controller Plugin are different, although they may sound alike. Read about Front Controller Plugin here.

Controller Action Helpers are the kind of Plugins that are tied to your Controller Actions, and just as Front Controller plugin, they can run specific tasks at some predefine stages of the MVC cycle; though this isn't mandatory. The key difference between Front controller plugins and Controller Action Helper is that your controllers can interact with action helpers to change their behavior, or use some on-demand functionality while this is not the case with Front Controller plugins.