Added template_from_string() twig function

This commit is contained in:
Matias Griese
2019-10-16 14:00:37 +03:00
parent 2db04e43d1
commit 7902912269
2 changed files with 3 additions and 0 deletions

View File

@@ -5,6 +5,7 @@
* Added `Flex Pages` to Grav core and removed Flex Objects plugin dependency
* Added `Utils::simpleTemplate()` method for very simple variable templating
* Added `array_diff()` twig function
* Added `template_from_string()` twig function
1. [](#improved)
* Improved `Flex Users`: obey blueprints and allow Flex to be used in admin only
* Improved `Flex` to support custom site template paths

View File

@@ -23,6 +23,7 @@ use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Extension\CoreExtension;
use Twig\Extension\DebugExtension;
use Twig\Extension\StringLoaderExtension;
use Twig\Loader\ArrayLoader;
use Twig\Loader\ChainLoader;
use Twig\Loader\FilesystemLoader;
@@ -198,6 +199,7 @@ class Twig
}
$this->twig->addExtension(new TwigExtension());
$this->twig->addExtension(new DeferredExtension());
$this->twig->addExtension(new StringLoaderExtension());
$this->profile = new \Twig\Profiler\Profile();
$this->twig->addExtension(new \Twig\Extension\ProfilerExtension($this->profile));