Astina Money Bundle
Symfony bundle for 99designs/money-php., (*1)
Adds exchange rate entity and a service for conversion., (*2)
Installation
Step 1: Add to composer.json
"require": {
"astina/money-bundle":"dev-master",
}
Step 2: Enable the bundle
Enable the bundle in the kernel:, (*3)
<?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., (*4)
$moneyChf = new Money\Money(190, 'CHF');
$moneyConverter = $container->get('astina_money.money_converter');
$moneyEur = $moneyConverter->convert($money, 'EUR');