/** * */ public function processRequest($uri, $method) { $router = $this->injector->getStored("framework.router"); $kernel = $this->injector->getStored("framework.kernel"); $router->detectCurrentRoute($uri, $method); $kernel->getRequest()->assignExpressionValues($router); $this->application->determineController(); $this->application->determineAction(); $this->application->executeAction(); }
/** * */ public function executeAction() { $action = $this->action; if (!method_exists($this->controller, $action)) { $this->kernel->getResponse()->addValue("error", "Method '" . $action . "' in Class '" . $this->controller . "' does not exist."); return; } $injectedParameters = $this->injector->injectActionParameters($this->kernel, $this->controller, $this->action); $this->controller->{$action}(...$injectedParameters); }
/** * */ public function run() { try { /** * @var Application $application */ $application = $this->injector->injectClass("framework.application"); } catch (DeclarationNotFound $e) { $application = $this->handleError($e); } catch (ClassNotFound $e) { $application = $this->handleError($e); } catch (WrongArguments $e) { $application = $this->handleError($e); } catch (\Exception $e) { $application = $this->handleError($e); } $application->init($this->applicationConfig); $application->determineController(); $application->determineAction(); $application->executeAction(); $this->response = $application->returnResponse(); }