/**
  *
  */
 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();
 }
Exemple #2
0
 /**
  *
  */
 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);
 }
Exemple #3
0
 /**
  *
  */
 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();
 }