8000 [Cookbook][Templating] custom Twig Extension by inoryy · Pull Request #1215 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Cookbook][Templating] custom Twig Extension #1215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 11, 2012
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
passing arguments to filter example
  • Loading branch information
inoryy committed Apr 3, 2012
commit 36335c7a68e7424f45cdda22a5bedd71624dd595
7 changes: 7 additions & 0 deletions cookbook/templating/twig_extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ Using your newly created Twig Extension is no different than any other:
{# outputs $5,500.00 #}
{{ '5500' | price }}

Passing other arguments to your filter:

.. code-block:: html+jinja

{# outputs $5500,2516 #}
{{ '5500.25155' | price(4, ',', '') }}

Learning further
----------------

Expand Down
0