Exemple #1
0
 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;
 }
Exemple #2
0
 /**
  * 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;
 }
Exemple #3
0
 /**
  * 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;
 }
Exemple #4
0
 public function setView(\Hoa\View\Viewable $view)
 {
     $this->view = $view;
     $this->data = $view->getData();
     return $this;
 }