adrianheras / amount-symbol
Amount symbol Twig extension where you can easily add symbol to amounts like currencies and percentages
1.0
2015-05-12 19:42 UTC
Requires
- php: >=5.3.0
- adrianheras/amount-symbol: 1.*
- twig/twig: ~1.12
This package is not auto-updated.
Last update: 2024-11-09 18:32:42 UTC
README
This is a Twig extension for Symfony2 Framework where you can easily add symbol to amounts like currencies and percentages.
For example
{{ merkat.cash|amount_symbol("EUR") }}
Outputs 70.95 €
Installation for Symfony2
- Update your composer.json
"require": { "adrianheras/amount-symbol": "1.*" }
or use composer's require command:
composer require adrianheras/amount-symbol:1.*
- Register an Extension as a Service
Now you must let the Service Container know about your newly created Twig Extension:
YAML:
# app/config/config.yml services: adrianheras.twig.amount_symbol: class: AdrianHeras\Twig\Extension\AmountSymbolExtension tags: - { name: twig.extension }
XML:
# or into your bundle src\Acme\AcmeBundle\Resources\config\services.xml <service id="adrianheras.twig.amount_symbol" class="AdrianHeras\Twig\Extension\AmountSymbolExtension"> <tag name="twig.extension" /> </service>