mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-18 05:16:30 +00:00
Slug filter: Mentioning requiredStringExtension
See https://github.com/twigphp/Twig/issues/3500#issuecomment-814923747
This commit is contained in:
@@ -30,6 +30,24 @@ argument:
|
|||||||
The ``slug`` filter uses the method by the same name in Symfony's
|
The ``slug`` filter uses the method by the same name in Symfony's
|
||||||
`AsciiSlugger <https://symfony.com/doc/current/components/string.html#slugger>`_.
|
`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
|
Arguments
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user