xigen.io / currency-converter-bundle
There is no license information available for the latest version (v2.0.1) of this package.
Currency Converter bundle for Symfony
Package info
github.com/XigenIO/Symfony-CurrencyConverterBundle
Type:symfony-bundle
pkg:composer/xigen.io/currency-converter-bundle
v2.0.1
2019-01-26 14:46 UTC
Requires
- php: ^7.2
- guzzlehttp/guzzle: ^6.3
- symfony/framework-bundle: ^3.4|^4
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Currency Converter bundle for Symfony
Provides an easy way to convert an amount of GBP to common currencies within a Symfony project using the fixer.io API. Rates are stored in the symfony cache for a maximum of 4 hours before being updated automaticly.
Installation
composer require xigen.io/currency-converter-bundle
Finally register the bundle in app/AppKernel.php (if using Symfony 3):
$bundles = [ [...] new Xigen\Bundle\CurrencyConverterBundle\CurrencyConverterBundle(), ];
Usage
// Fetch the convert service $convert = $this->getContainer()->get('currency_converter.convert'); // Convert 10 euros into pounds $pounds = $convert->from('EUR', 10); // Convert 10 pounds into euros $euros = $convert->to('EUR', 10); dump([ 'pounds' => $pounds, 'euros' => $euros, ]);