2017 © Pedro Peláez
 

symfony-bundle currency-bundle

FlagbitCurrencyBundle for the Symfony Framework

image

flagbit/currency-bundle

FlagbitCurrencyBundle for the Symfony Framework

  • Monday, July 23, 2018
  • by flagbit
  • Repository
  • 15 Watchers
  • 0 Stars
  • 159 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 3 % Grown

The README.md

FlagbitCurrencyBundle

Build Status SensioLabsInsight License Scrutinizer Code Quality, (*1)

About

The FlagbitCurrencyBundle provides basic functions to display currency symbols and names., (*2)

Configuration

You can set your default currency. The bundle defaults to EUR. Currency code has to be UPPERCASE., (*3)

flagbit_currency:
    default_currency: EUR

Services

Fetch the global default currency., (*4)

$container->get('flagbit_currency')->getDefaultCurrency(); // EUR

Fetch the currency name. Actual output depends on your locale set., (*5)

$container->get('flagbit_currency')->getCurrencyName(); // Euro
$container->get('flagbit_currency')->getCurrencyName('EUR'); // Euro
$container->get('flagbit_currency')->getCurrencyName('USD'); // US Dollar

Fetch the symbol for the default currency or a given currency., (*6)

$container->get('flagbit_currency')->getCurrencySymbol(); // €
$container->get('flagbit_currency')->getCurrencySymbol('EUR'); // €
$container->get('flagbit_currency')->getCurrencySymbol('USD'); // $

It is recommended, that you don't fetch a service directly from a container and use dependency injection instead., (*7)

Twig

Functions

currency_name

Fetch the currency name. Actual output depends on your locale set., (*8)

{{ currency_name() }} {# example output: Euro #}
{{ currency_name('EUR') }} {# example output: Euro #}
{{ currency_name('USD') }} {# example output: US Dollar #}

curreny_symbol

Fetch the symbol for the default currency or a given currency., (*9)

{{ currency_symbol() }} {# example output: € #}
{{ currency_symbol('CHF') }} {# example output: CHF #}
{{ currency_symbol('EUR') }} {# example output: € #}

Globals

The default currency code is available as variable., (*10)

{{ currency.default }} {# example output: EUR #}

The Versions

30/04 2014
15/04 2014

1.0.0

1.0.0.0

FlagbitCurrencyBundle for the Symfony Framework

  Sources   Download

BSD-3-Clause

The Requires