Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit51a010e

Browse files
committed
minor#12980 Updated the intro of the Twig extensions article (javiereguiluz)
This PR was merged into the 4.3 branch.Discussion----------Updated the intro of the Twig extensions articleFixes#12971.Commits-------79eeda7 Updated the intro of the Twig extensions article
2 parents8f4ed4b +79eeda7 commit51a010e

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

‎templating/twig_extension.rst

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,13 @@
44
How to Write a custom Twig Extension
55
====================================
66

7-
`Twig Extensions`_ allow to create custom Twig functions, filters and more to
8-
use them in your templates.
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
9+
the filter/function that you need is already implemented in:
910

10-
Before writing your own Twig extension, check if the filter/function that you
11-
need is already implemented in the `default Twig filters and functions`_ or the
12-
:doc:`Twig filters and functions added by Symfony</reference/twig_reference>`.
13-
Check also the `official Twig GitHub organization`_, which contains some extra
14-
repositories that provide extensions for common needs (such as ``string-extra``,
15-
``html-extra``, ``intl-extra``, etc.)
16-
17-
..code-block::terminal
18-
19-
$ composer require twig/extensions
11+
* The `default Twig filters and functions`_;
12+
* The:doc:`Twig filters and functions added by Symfony</reference/twig_reference>`;
13+
* The `official Twig extensions`_ related to strings, HTML, Markdown, internationalization, etc.
2014

2115
Create the Extension Class
2216
--------------------------
@@ -178,5 +172,5 @@ for this class and :doc:`tag your service </service_container/tags>` with ``twig
178172

179173
.. _`Twig Extensions`:https://twig.symfony.com/doc/2.x/advanced.html#creating-an-extension
180174
.. _`default Twig filters and functions`:https://twig.symfony.com/doc/2.x/#reference
181-
.. _`official TwigGitHub organization`:https://github.com/twigphp
175+
.. _`official Twigextensions`:https://github.com/twigphp?q=extra
182176
.. _`global variables`:https://twig.symfony.com/doc/2.x/advanced.html#id1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp