Slug filter: Mentioning requiredStringExtension

See https://github.com/twigphp/Twig/issues/3500#issuecomment-814923747
This commit is contained in:
Thomas Landauer
2021-04-07 16:56:57 +02:00
committed by GitHub
parent cdd521375e
commit 84f6e32f30
+18
View File
@@ -30,6 +30,24 @@ argument:
The ``slug`` filter uses the method by the same name in Symfony's
`AsciiSlugger <https://symfony.com/doc/current/components/string.html#slugger>`_.
.. note::
The ``slug`` filter is part of the ``StringExtension`` which is not
installed by default. Install it first:
.. code-block:: bash
$ composer require twig/string-extra
Then, use the ``twig/extra-bundle`` on Symfony projects or add the extension
explicitly on the Twig environment::
use Twig\Extra\String\StringExtension;
$twig = new \Twig\Environment(...);
$twig->addExtension(new StringExtension());
Arguments
---------