hastags = false; $this->mustache = new \Mustache_Engine([ 'loader' => new \Mustache_Loader_FilesystemLoader($this->config->get('templatedir')), // Create a urlencodde helper for use in template. E.g. using siteurl in icon.php query param. 'helpers' => array('urlencode' => function($text, $renderer) { return urlencode($renderer($text)); }), ]); // Get a Nette session section for CSRF data. $csrfsection = $this->session->getSection('csrf'); // Create a new CSRF token within the section if one doesn't exist already. if (!$csrfsection->offsetExists('token')){ $csrfsection->set('token', bin2hex(random_bytes(32))); } } abstract protected function render_content(): string; abstract protected function render_header(): string; abstract protected function render_footer(): string; protected function build_page(): void { $this->outputarray = [ $this->render_header(), $this->render_content(), $this->render_footer(), ]; } public function get_output(): string { $this->build_page(); return implode('', $this->outputarray); } }