protected function loadObject($metadata, $name) { $object = null; if (!empty($metadata['className'])) { $object = new $metadata['className'](); } else { if (!empty($metadata['module'])) { $object = $this->application->getModule($metadata['module']); } } if (empty($object)) { throw new \Exception('class or module for "' . $name . '" not define'); } return $object; }
public function dispatch() { $frontControllerName = $this->router->getParam('frontController', 'FrontController_Macros'); $frontController = $this->application->getModule($frontControllerName); $frontController->execute(); }