New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Twig_Loader_String is deprecated #3424
Comments
Some hint to solve this: twigphp/Twig#1641 |
Ah, that workaround seems doable.. Great example, too! $env = new \Twig_Environment(new \Twig_Loader_Array());
$template = $env->createTemplate('Hello, {{ name }}');
echo $env->render($template, array('name' => 'Bob')); // Hello, Bob |
@bobdenotter you only like it because of that example name ;-) |
$env = new \Twig_Environment(new \Twig_Loader_Array()); This won't work as |
@jeroenvdgulik yeah, we're just planning on implementing our own class sans a better idea. |
It took me some time to figure this out so maybe this is useful for you guys. This works: $env = new \Twig_Environment(new \Twig_Loader_Array(['my_template_name' => 'Hello, {{ name }}']));
$html = $env->render('my_template_name', array('name' => 'Bob')); |
I think what we need to do is not have a separate Twig functions/filters can already be defined with an |
Bumping this to a 2.4 milestone as @CarsonF has a branch in progress, but has too much flux for this stage in 2.3-dev. |
Any progress on this? |
Nope. We could probably just copy their source. |
Fixed in 3.3 with sandbox |
Safe twig uses
Twig_Loader_String
which is deprecated as of1.18.1
The text was updated successfully, but these errors were encountered: