File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -22,20 +22,24 @@ any related error message:
2222 .. note ::
2323
2424 The ``template_from_string `` function is not available by default.
25-
26- In Symfony projects, you need to load it in your ``services.yaml ``::
25+
26+ On Symfony projects, you need to load it in your ``services.yaml `` file:
27+
28+ .. code-block :: yaml
2729
2830 services :
2931 Twig\Extension\StringLoaderExtension :
3032
31- or ``services.php ``::
33+ or ``services.php `` file ::
3234
3335 $services->set(\Twig\Extension\StringLoaderExtension::class);
34-
36+
3537 Otherwise, add the extension explicitly on the Twig environment::
3638
39+ use Twig\Extension\StringLoaderExtension;
40+
3741 $twig = new \Twig\Environment(...);
38- $twig->addExtension(new \Twig\Extension\ StringLoaderExtension());
42+ $twig->addExtension(new StringLoaderExtension());
3943
4044.. note ::
4145
You can��t perform that action at this time.
0 commit comments