Open RyanThompson opened 9 years ago
+1
What do you mean exactly? Can you give an example of what you want?
string-render('{{ example_func() }}', [vars]);
I have a bound instance of the bridge using the string loader in Pyro:
https://github.com/anomalylabs/streams-platform/blob/1.0/develop/src/Support/String.php
StringLoader is deprecated and removed in 2.0. See https://github.com/twigphp/Twig/pull/1641
Does something like this work?
$template = Twig::createTemplate('{{ example_func() }}');
echo Twig::render($template, $vars);
I suppose it could be used to make a helper method, for Twig::renderString('{{ example_func() }}', $vars)
, not sure if it's needed.
It would be awesome if this came packaged with a string loader version of twig as an alias.