ivoba / money-twig-extension
Twig extension for moneyphp/money
Installs: 53 983
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.6
- moneyphp/money: ^3.1
- symfony/intl: >=2.3
- twig/twig: ~1.20|~2.0
Requires (Dev)
- phpunit/phpunit: 4.*
- scrutinizer/ocular: ~1.1
This package is auto-updated.
Last update: 2024-11-10 22:20:37 UTC
README
Twig Extension for Money value object
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.