Skip to content

Commit 9170edf

Browse files
committed
Fix doc CS
1 parent fab3e0f commit 9170edf

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

doc/functions/template_from_string.rst

+9-5
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)