@@ -1288,42 +1288,6 @@ For information on how to create the actual Twig Extension class, see
12881288`Twig's documentation `_ on the topic or read the
12891289:doc: `/templating/twig_extension ` article.
12901290
1291- Before writing your own extensions, have a look at the
1292- `Twig official extension repository `_ which already includes several
1293- useful extensions. For example ``Intl `` and its ``localizeddate `` filter
1294- that formats a date according to user's locale. These official Twig extensions
1295- also have to be added as regular services:
1296-
1297- .. configuration-block ::
1298-
1299- .. code-block :: yaml
1300-
1301- services :
1302- Twig\Extensions\IntlExtension :
1303- tags : [twig.extension]
1304-
1305- .. code-block :: xml
1306-
1307- <?xml version =" 1.0" encoding =" UTF-8" ?>
1308- <container xmlns =" http://symfony.com/schema/dic/services"
1309- xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
1310- xsi : schemaLocation =" http://symfony.com/schema/dic/services
1311- https://symfony.com/schema/dic/services/services-1.0.xsd" >
1312-
1313- <services >
1314- <service id =" Twig\Extensions\IntlExtension" >
1315- <tag name =" twig.extension" />
1316- </service >
1317- </services >
1318- </container >
1319-
1320- .. code-block :: php
1321-
1322- $container
1323- ->register('Twig\Extensions\IntlExtension')
1324- ->addTag('twig.extension')
1325- ;
1326-
13271291twig.loader
13281292-----------
13291293
@@ -1404,6 +1368,5 @@ For an example, see the ``DoctrineInitializer`` class inside the Doctrine
14041368Bridge.
14051369
14061370.. _`Twig's documentation` : https://twig.symfony.com/doc/2.x/advanced.html#creating-an-extension
1407- .. _`Twig official extension repository` : https://github.com/fabpot/Twig-extensions
14081371.. _`SwiftMailer's Plugin Documentation` : http://swiftmailer.org/docs/plugins.html
14091372.. _`Twig Loader` : https://twig.symfony.com/doc/2.x/api.html#loaders
0 commit comments