public function __construct(HRouter $router, Dispatcher $dispatcher, Viewable $view, Framework $framework) { $this->framework = $framework; $this->router = $router; $this->dispatcher = $dispatcher; $this->view = $view; $this->env = $this->framework->getEnvironnement(); if (null !== $view) { $this->data = $view->getData(); } return; }
/** * Initialize the view : create the default view if not already given, and inject framework to the view * @return \Sohoa\Framework\Framework */ public function initView() { if (!$this->_view) { $this->_view = new Greut(); } $this->_view->setFramework($this); return $this; }
/** * Build a dispatcher kit. * * @param \Hoa\Router $router The router. * @param \Hoa\Dispatcher $dispatcher The dispatcher. * @param \Hoa\View\Viewable $view The view. * @return void */ public function __construct(Router $router, Dispatcher $dispatcher, View\Viewable $view = null) { $this->router = $router; $this->dispatcher = $dispatcher; $this->view = $view; if (null !== $view) { $this->data = $view->getData(); } return; }
public function setView(\Hoa\View\Viewable $view) { $this->view = $view; $this->data = $view->getData(); return $this; }