Created
February 2, 2012 17:47
-
-
Save weierophinney/1724828 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Foo; | |
use Zend\EventManager\StaticEventManager; | |
class Module | |
{ | |
protected $manager; | |
public function init($manager) | |
{ | |
$this->manager = $manager; | |
$events = StaticEventManager::getInstance(); | |
$events->attach('bootstrap', 'bootstrap', array($this, 'bootstrap')); | |
} | |
public function bootstrap($e) | |
{ | |
foreach ($this->manager->getLoadedModules() as $module) { | |
if ($module === $this) { | |
continue; | |
} | |
// process the module -- maybe check for an interface and call a | |
// method based on that match. | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment