mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-16 12:26:30 +00:00
Fix doc CS
This commit is contained in:
@@ -22,20 +22,24 @@ any related error message:
|
||||
.. note::
|
||||
|
||||
The ``template_from_string`` function is not available by default.
|
||||
|
||||
In Symfony projects, you need to load it in your ``services.yaml``::
|
||||
|
||||
On Symfony projects, you need to load it in your ``services.yaml`` file:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
services:
|
||||
Twig\Extension\StringLoaderExtension:
|
||||
|
||||
or ``services.php``::
|
||||
or ``services.php`` file::
|
||||
|
||||
$services->set(\Twig\Extension\StringLoaderExtension::class);
|
||||
|
||||
|
||||
Otherwise, add the extension explicitly on the Twig environment::
|
||||
|
||||
use Twig\Extension\StringLoaderExtension;
|
||||
|
||||
$twig = new \Twig\Environment(...);
|
||||
$twig->addExtension(new \Twig\Extension\StringLoaderExtension());
|
||||
$twig->addExtension(new StringLoaderExtension());
|
||||
|
||||
.. note::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user