public function __construct($renderer = '', $paths = []) { $this->meta = new Meta(); if (empty($renderer) || 'vanilla' == $renderer) { $this->renderer = new Vanilla($paths); } else { $class = '\\T4\\Mvc\\Renderers\\' . ucfirst($renderer); if (class_exists($class)) { $this->renderer = new $class($paths); } else { $this->renderer = new Vanilla($paths); } } if (method_exists($this->renderer, 'setView')) { $this->renderer->setView($this); } }
public function setView(View $view) { parent::setView($view); $this->links->view = $this->view; $this->twig->addGlobal('view', $this->links->view); }