astina / money-bundle
Installs: 940
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 19
Forks: 0
Type:symfony-bundle
Requires
- 99designs/money-php: v1.0.0
This package is not auto-updated.
Last update: 2023-02-13 05:48:55 UTC
README
Symfony bundle for 99designs/money-php.
Adds exchange rate entity and a service for conversion.
Installation
Step 1: Add to composer.json
"require": { "astina/money-bundle":"dev-master", }
Step 2: Enable the bundle
Enable the bundle in the kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Astina\Bundle\MoneyBundle\AstinaMoneyBundle(), ); }
##Usage
Note*: CurrencyExchangeRate entities need to be created for the exchanges you need.
$moneyChf = new Money\Money(190, 'CHF'); $moneyConverter = $container->get('astina_money.money_converter'); $moneyEur = $moneyConverter->convert($money, 'EUR');