Skip to content

Commit bf5d0c3

Browse files
committed
minor #16769 [Twig] Update twig_extension.rst (CJDennis)
This PR was merged into the 4.4 branch. Discussion ---------- [Twig] Update twig_extension.rst Improve grammar <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `6.x` for features of unreleased versions). --> Commits ------- c935226 Update twig_extension.rst
2 parents 1273311 + c935226 commit bf5d0c3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

templating/twig_extension.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
How to Write a custom Twig Extension
55
====================================
66

7-
`Twig Extensions`_ allow to create custom functions, filters and more to use
8-
them in your Twig templates. Before writing your own Twig extension, check if
7+
`Twig Extensions`_ allow the creation of custom functions, filters, and more to use
8+
in your Twig templates. Before writing your own Twig extension, check if
99
the filter/function that you need is already implemented in:
1010

1111
* The `default Twig filters and functions`_;
@@ -16,7 +16,7 @@ Create the Extension Class
1616
--------------------------
1717

1818
Suppose you want to create a new filter called ``price`` that formats a number
19-
into money:
19+
as currency:
2020

2121
.. code-block:: twig
2222
@@ -117,7 +117,7 @@ them) performance is not affected. However, if extensions define lots of complex
117117
dependencies (e.g. those making database connections), the performance loss can
118118
be significant.
119119

120-
That's why Twig allows to decouple the extension definition from its
120+
That's why Twig allows decoupling the extension definition from its
121121
implementation. Following the same example as before, the first change would be
122122
to remove the ``formatPrice()`` method from the extension and update the PHP
123123
callable defined in ``getFilters()``::

0 commit comments

Comments
 (0)