Twig Extension for sebastian/money value object
PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
tests
.editorconfig
.gitattributes
.gitignore
.scrutinizer.yml
.travis.yml
CHANGELOG.md
CONTRIBUTING.md
LICENSE.md
README.md
composer.json
phpunit.xml.dist

README.md

money-twig-extension

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.