1
1
.. index ::
2
2
single: Using the Twig Extensions Repository
3
3
4
- How to Use the Twig Extension Repository
4
+ How to Use the Twig Extensions Repository
5
5
========================================
6
6
7
7
The `Twig official extension repository `_ contains (as of writing) some
8
8
helpful Twig extensions that are not part of the Twig core. They add
9
- useful functions for internationalization, working with Arrays and
9
+ useful functions for internationalization, working with arrays and
10
10
dates. To learn more about these extensions, have a look at their
11
11
`documentation `_.
12
12
@@ -40,7 +40,7 @@ Then, define the extension class as a service and tag it with the
40
40
41
41
# app/config/services.yml
42
42
services :
43
- twig_extension .intl :
43
+ twig_extensions .intl :
44
44
class : Twig_Extensions_Extension_Intl
45
45
tags :
46
46
- { name: twig.extension }
@@ -55,7 +55,7 @@ Then, define the extension class as a service and tag it with the
55
55
http://symfony.com/schema/dic/services/services-1.0.xsd" >
56
56
57
57
<services >
58
- <service id =" twig_extension .intl"
58
+ <service id =" twig_extensions .intl"
59
59
class =" Twig_Extensions_Extension_Intl" >
60
60
<tag name =" twig.extension" />
61
61
</service >
@@ -68,7 +68,7 @@ Then, define the extension class as a service and tag it with the
68
68
use \Twig_Extensions_Extension_Intl;
69
69
70
70
$container
71
- ->register('twig_extension .intl', Twig_Extensions_Extension_Intl::class)
71
+ ->register('twig_extensions .intl', Twig_Extensions_Extension_Intl::class)
72
72
->addTag('twig.extension');
73
73
74
74
And that's it! For example, you should now be able to use the
@@ -84,10 +84,9 @@ Learning further
84
84
85
85
In the :doc: `reference section </reference/twig_reference >`, you can
86
86
find all the extra Twig functions, filters, tags and tests that are
87
- added by the Symfony Framework.
87
+ already added by the Symfony Framework.
88
88
89
- When that does not meet your particular needs, we also have
90
- documentation on :doc: `how to write your own Twig extension </templating/twig_extension >`.
89
+ We also have documentation on :doc: `how to write your own Twig extension </templating/twig_extension >`.
91
90
92
91
.. _`Twig official extension repository` : https://github.com/twigphp/Twig-extensions
93
92
.. _`documentation` : http://twig-extensions.readthedocs.io/
0 commit comments