Example #1
0
 /**
  * Init the controller of a route
  *
  * @return null|*
  */
 public function initRouteController()
 {
     $this->routeController = new $this->controllerClass();
     if (true == $this->routeController instanceof \Fewlines\Core\Controller\View) {
         $template = Template::getInstance();
         $this->routeController->init($template);
         return $this->callRouteMethod($this->activeRoute->getToMethod(), $this->activeRoute->getVarsRecursive());
     } else {
         throw new View\Exception\ControllerInitialisationGoneWrongException('The route controller could not be initialized.
             Must be instance of \\Fewlines\\Controller\\View');
     }
     return null;
 }