diff options
author | msquare <msquare@notrademark.de> | 2019-07-21 13:32:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-21 13:32:45 +0200 |
commit | d4d4b409b6fd96ca297af323936b8922d45b6eda (patch) | |
tree | 6c8efa1a1e429f3965820838796cb4b97cd2df11 /src/Renderer/TwigEngine.php | |
parent | d5bf7fd065a5ea93dea9fd55e6ac225ee062a3db (diff) | |
parent | 51a3c6eb44a5dbdf9d7a3cfac678f0d29b0d3eef (diff) |
Merge pull request #622 from MyIgel/controllers
AuthController (login, logout), use templating, replaced gettext, input validation
Diffstat (limited to 'src/Renderer/TwigEngine.php')
-rw-r--r-- | src/Renderer/TwigEngine.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Renderer/TwigEngine.php b/src/Renderer/TwigEngine.php index 55a2e299..aa51a177 100644 --- a/src/Renderer/TwigEngine.php +++ b/src/Renderer/TwigEngine.php @@ -7,7 +7,7 @@ use Twig_Error_Loader as LoaderError; use Twig_Error_Runtime as RuntimeError; use Twig_Error_Syntax as SyntaxError; -class TwigEngine implements EngineInterface +class TwigEngine extends Engine { /** @var Twig */ protected $twig; @@ -25,8 +25,10 @@ class TwigEngine implements EngineInterface * @return string * @throws LoaderError|RuntimeError|SyntaxError */ - public function get($path, $data = []) + public function get(string $path, array $data = []): string { + $data = array_replace_recursive($this->sharedData, $data); + return $this->twig->render($path, $data); } @@ -34,7 +36,7 @@ class TwigEngine implements EngineInterface * @param string $path * @return bool */ - public function canRender($path) + public function canRender(string $path): bool { return $this->twig->getLoader()->exists($path); } |