Skip to content
Snippets Groups Projects
Unverified Commit c2ab8b16 authored by Tim van Dijen's avatar Tim van Dijen Committed by GitHub
Browse files

1 too many

We were echoing the result of require(), resulting in a '1' being printed during login
parent 2a7ea4ea
No related branches found
No related tags found
No related merge requests found
...@@ -476,16 +476,11 @@ class Template extends Response ...@@ -476,16 +476,11 @@ class Template extends Response
*/ */
protected function getContents() protected function getContents()
{ {
if ($this->twig !== false) { $this->twigDefaultContext();
$this->twigDefaultContext(); if ($this->controller) {
if ($this->controller) { $this->controller->display($this->data);
$this->controller->display($this->data);
}
$content = $this->twig->render($this->twig_template, $this->data);
} else {
$content = require($this->findTemplatePath($this->template));
} }
return $content; return = $this->twig->render($this->twig_template, $this->data);
} }
...@@ -508,11 +503,15 @@ class Template extends Response ...@@ -508,11 +503,15 @@ class Template extends Response
* This method is a remnant of the old templating system, where templates where shown manually instead of * This method is a remnant of the old templating system, where templates where shown manually instead of
* returning a response. * returning a response.
* *
* @deprecated Do not use this method, use send() instead. * @deprecated Do not use this method, use Twig + send() instead. Will be removed in 2.0
*/ */
public function show() public function show()
{ {
echo $this->getContents(); if ($this->twig !== false) {
echo $this->getContents();
} else {
require($this->findTemplatePath($this->template));
}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment