/** * {@inheritdoc} */ public function __construct($options = [], Application $app = null) { $templatePaths = new TemplatePaths(); $this->app = $app; $templatePaths->setTemplateRootPaths(array(base_path() . '/resources/Private/Templates/')); $templatePaths->setLayoutRootPaths(array(base_path() . '/resources/Private/Layouts/')); $templatePaths->setPartialRootPaths(array(base_path() . '/resources/Private/Partials/')); $this->view = new TemplateView($templatePaths); $context = $this->view->getRenderingContext(); $context->setControllerName($this->determineControllerName()); $this->view->setRenderingContext($context); }
/** * Overridden setter with enforced sorting behavior * * @param array $templateRootPaths * @return void */ public function setTemplateRootPaths(array $templateRootPaths) { parent::setTemplateRootPaths(ArrayUtility::sortArrayWithIntegerKeys($templateRootPaths)); }