Skip to content

Commit

Permalink
Merge pull request Sylius#8368 from Mipme/docs-currency-money-helpers
Browse files Browse the repository at this point in the history
[Documentation][ShopBundle][TheBook] twig money format helpers
  • Loading branch information
CoderMaggie committed Aug 29, 2017
2 parents 4abdbea + 243c8a6 commit aa937d4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/book/configuration/currencies.rst
Expand Up @@ -71,6 +71,22 @@ the ``Sylius\Component\Core\Currency\CurrencyStorageInterface`` with methods
$container->get('sylius.storage.currency')->set($channel, 'PLN');
Displaying Currencies in the templates
--------------------------------------

There are some useful helpers for rendering money values in the front end.
Simply import the money macros of the ``ShopBundle`` in your twig template and use the functions to display the value:

.. code-block:: twig
..
{% import "@SyliusShop/Common/Macro/money.html.twig" as money %}
..
<span class="price">{{ money.format(price, 'EUR') }}</span>
Sylius provides you with some handy :doc:`Global Twig variables </customization/template>` to facilitate displaying money values even more.

Learn more
----------

Expand Down

0 comments on commit aa937d4

Please sign in to comment.