/** * Setup template engine. * * @param BaseReport $report */ protected function setTemplateEngine(BaseReport $report) { $basePath = $report->getReportPath(); $templatePaths = [$basePath, $this->container->getParameter('app_path') . '/resources/views']; $loader = new \Twig_Loader_Filesystem($templatePaths); $templatingHelper = $this->container->get('report_templating_helper'); $engine = new RenderEngine($loader, $report, $templatingHelper); $report->setRenderEngine($engine); }
/** * Setup template engine. * * @param BaseReport $report */ protected function setTemplateEngine(BaseReport $report) { $basePath = $report->getReportPath(); $templatePaths = [$basePath, $this->appPath . '/resources/views']; $loader = new \Twig_Loader_Filesystem($templatePaths); $extensionManager = new RenderEngineExtensionManager(); $router = new ReportRouting($this->templatingHelper, $report); $extensionManager->addExtension($router); $engine = new RenderEngine($loader, $report, [], $extensionManager); $report->setRenderEngine($engine); }