News Feed
Sections




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

Rob Allen's Blog:
Module specific bootstrapping in ZF2
March 08, 2012 @ 10:04:20

Rob Allen has a new post to his blog today looking at bootstrapping specific modules in a Zend Framework 2-based application without having to do the entire set.

Following on from the discussion on modules, we can hook into the event system to do module specific bootstrapping. By this, I mean, if you have some code that you want to run only if the action to be called is within this module, you can hook into the Application's dispatch event to achieve this.

He starts with an example of a basic module (Simple/Module.php) and shows how to define an "onBootstrap" method that calls the "onDispatch" method (when hooked to the event manager) to do some module-specific bootstrap operations. The RouteMatch feature is used to ensure that you're in the right controller/namespace combo to use the module.

0 comments voice your opinion now!
module bootstrap zendframework2 tutorial specific router dispatch


blog comments powered by Disqus

Similar Posts

PHPBuilder.com: Using the Factory Pattern in PHP Applications

PHPKitchen.com: Many new features in latest 0.6.2 release of Seagull Framework

John Lim's Blog: Parallel Processing in PHP

Rob Allen's Blog: Translations of my Zend Framework Tutorial for ZF 1.10 & 1.11

Matthew Weir O'Phinney's Blog: Cgiapp2 Tutorial 2 - Pluggable Applications


Community Events





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


language podcast zendserver community deployment conference tips list threedevsandamaybe bugfix release code voicesoftheelephpant interview api introduction laravel framework symfony series

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