News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

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

PHP in Action: The one-line web framework

Script-Tutorials.com: How to parse web pages using XPath

Padraic Brady's Blog: Zend Framework: Surviving The Deep End Book - Chapters 4, 5, 6, 7 and Appendix

Jim Plush's Blog: Rethinking Zend Models Part 3 - Validation

Enrise.com: REST Style Context Switching - Part 2


Community Events

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


api release interview introduction language podcast symfony2 opinion laravel series part2 example framework performance conference voicesoftheelephpant community configure php7 application

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