Skip to content

Instantly share code, notes, and snippets.

@weierophinney
Created November 8, 2011 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weierophinney/1348655 to your computer and use it in GitHub Desktop.
Save weierophinney/1348655 to your computer and use it in GitHub Desktop.
<?php
public function loadModule($moduleName)
{
if (!isset($this->loadedModules[$moduleName])) {
$class = $moduleName . '\Module';
$module = new $class;
$this->runModuleInit($module);
$this->mergeModuleConfig($module);
$this->loadedModules[$moduleName] = $module;
$event = new ModuleEvent($module);
$this->events()->trigger(__FUNCTION__, $this, $event);
}
return $this->loadedModules[$moduleName];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment