/** * {@inheritdoc} */ public function getHandlebars() { if (is_null($this->templateEngine)) { $templates_loader = new \Handlebars\Loader\FilesystemLoader(MIBEW_FS_ROOT . '/' . $this->getFilesPath() . '/templates_src/server_side/'); $this->templateEngine = new \Handlebars\Handlebars(array('loader' => $templates_loader, 'partials_loader' => $templates_loader, 'helpers' => new Helpers())); // Use custom function to escape strings $this->templateEngine->setEscape('safe_htmlspecialchars'); $this->templateEngine->setEscapeArgs(array()); } return $this->templateEngine; }