Beispiel #1
0
 /**
  * Inits with the template
  *
  * @param  \Fewlines\Core\Template\Template $template
  */
 public function init(\Fewlines\Core\Template\Template &$template)
 {
     $this->template = $template;
     $this->httpRequest = Router::getInstance()->getRequest();
     $this->httpResponse = $this->httpRequest->getResponse();
     $this->view = $this->template->getView();
     $this->layout = $this->template->getLayout();
     if (method_exists($this, 'postInit')) {
         call_user_func(array($this, 'postInit'));
     }
 }
Beispiel #2
0
 /**
  * Init the router with a
  * given Request
  *
  * @param Request $request
  */
 public function __construct(Request $request)
 {
     // Set url components
     $this->setBaseUrl();
     $this->url = $request->getUrl();
     // Save request
     $this->request = $request;
     // Initial update
     $this->update();
     // Save instance for further usage
     self::$instance = $this;
 }