diff options
Diffstat (limited to 'src/Renderer')
-rw-r--r-- | src/Renderer/TwigServiceProvider.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/Renderer/TwigServiceProvider.php b/src/Renderer/TwigServiceProvider.php index 57ebe9e5..d7b6bd09 100644 --- a/src/Renderer/TwigServiceProvider.php +++ b/src/Renderer/TwigServiceProvider.php @@ -62,7 +62,21 @@ class TwigServiceProvider extends ServiceProvider $this->app->instance(TwigLoaderInterface::class, $twigLoader); $this->app->instance('twig.loader', $twigLoader); - $twig = $this->app->make(Twig::class); + $cache = $this->app->get('path.cache.views'); + if ($config->get('environment') == 'development') { + $cache = false; + } + + $twig = $this->app->make( + Twig::class, + [ + 'options' => [ + 'cache' => $cache, + 'auto_reload' => true, + 'strict_variables' => ($config->get('environment') == 'development'), + ], + ] + ); $this->app->instance(Twig::class, $twig); $this->app->instance('twig.environment', $twig); |