News Feed
Jobs Feed
Sections




News Archive
Daniel Cousineau's Blog:
Zend Framework Module Init Script (Controller Plugin)
January 07, 2009 @ 09:35:41

Daniel Cousineau has a new blog post showing off a plugin he's made for Zend Framework applications that allows you to run a script before each controller.

Recently at work I had the need to run a script before every single controller (namely to add a plugin folder to Dwoo) for a specific module that I did not desire for any other modules. I could have subclassed all my controllers to extend a custom action controller that handled this in the init() method, however I'm lazy so I wrote a quick Zend Controller Plugin to handle this for me.

The plugin actually runs when the routeShutdown method is used (after the routing is done, but before the controller is called) and pulls in the contents of the specified file and executes it like the code was already embedded. Complete code is included.

0 comments voice your opinion now!
controller plugin zendframework module init script tutorial


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: SQLite: Lean, Mean DB Machine

Artur Ejsmont's Blog: How to build mongodb pecl extension in 32bit for PHP 5.2 on OSX Snow Leaopard

Jonathan Street's Blog: Plugins for php frameworks

NETTUTS.com: Anatomy of a WordPress Plugin

Noupe.com: 20 Useful PHP Components & Tutorials for Everyday Project


Community Events











Don't see your event here?
Let us know!


podcast development example series functional code interview object release language introduction phpunit framework zendframework2 testing unittest community tool opinion composer

All content copyright, 2013 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework