public function dispatch(\framework\core\Request $request) { $config = $this->getConfig('modulesLocation'); $actionExists = false; if (isset($config[$request->getModule()])) { $classname = $this->getModuleNamespace($request->getModule()) . '\\controllers\\' . $request->getAction(); if (\class_exists($classname)) { $actionExists = true; } } if (!$actionExists) { return $this->createRequest('errors', 'error404', array(), $request->getState())->execute(); } $module = $this->getComponent('action', $classname); $response = $this->getComponent('response'); return $module->execute($request, $response); }
protected function _before(\framework\core\Request &$request, \framework\core\Response &$response) { if ($request->getState() != \framework\core\Request::CLI_STATE) { //$this->getContainer()->getNewRequest('errors', 'error403', array($request))->execute(); } }