Skip to content

Instantly share code, notes, and snippets.

@weierophinney
Created February 2, 2012 17:47
Show Gist options
  • Save weierophinney/1724828 to your computer and use it in GitHub Desktop.
Save weierophinney/1724828 to your computer and use it in GitHub Desktop.
<?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