ivoba/money-twig-extension

Twig extension for moneyphp/money

2.0.1 2018-04-27 11:34 UTC

This package is auto-updated.

Last update: 2024-04-10 21:07:39 UTC


README

Twig Extension for Money value object

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Install

Via Composer

$ composer require ivoba/money-twig-extension

Usage

Register the Twig Extension according to the framework you are using.

Symfony Example:

<service id="ivoba_money_twig_extension" class="Ivoba\Money\Twig\MoneyExtension">
  <tag name="twig.extension" />
</service>

In your templates use like so:

 {{ money.convertedAmount }} 213.23
 {{ money|money_i18n_format('de_DE') }} 1.123,45 €
 {{ money|money_i18n_format('en_US') }} €1,123.45
 {{ money|money_i18n_decimal('en_US') }} 1,123.45
 {{ money|money_currency_symbol('en_US') }} €
 {{ money|money_currency_name('en_US') }} Euro

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.