Skip to content
Snippets Groups Projects
Commit 63179747 authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Make getContents public to be able to use Twig templates for other things then...

Make getContents public to be able to use Twig templates for other things then web pages (i.e. mail templates)
parent 51c0f186
No related branches found
No related tags found
No related merge requests found
......@@ -540,12 +540,14 @@ class Template extends Response
* @return string The HTML rendered by this template, as a string.
* @throws \Exception if the template cannot be found.
*/
protected function getContents(): string
public function getContents(): string
{
$this->twigDefaultContext();
if ($this->controller) {
$this->controller->display($this->data);
}
try {
return $this->twig->render($this->twig_template, $this->data);
} catch (RuntimeError $e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment