astina/money-bundle

There is no license information available for the latest version (0.1.0) of this package.

Installs: 936

Dependents: 0

Suggesters: 0

Stars: 0

Watchers: 17

Forks: 0

Type:symfony-bundle

0.1.0 2013-04-29 06: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');