Componette

Componette

h4kuna

h4kuna / exchange-nette

Exchange extension for Nette framework.

download-cloud-line composer require h4kuna/exchange-nette

Exchange extension for Nette framework

Latest stable Downloads this Month

This library is extension for Nette Framework and for this Exchange.

Installation

Simple via composer

$ composer require h4kuna/exchange-nette

Registration

First step is registration extension and set tempDir.

extensions:
    exchangeExtension: h4kuna\Exchange\DI\ExchangeExtension 

Extension is ready to use other configuration are optionally. Default is defined three currencies CZK, EUR and USD. Currencies has default format by h4kuna/number-format, where is documentation.

Configuration

Format options for currency read h4kuna/number-format

exchangeExtension:
    currencies:
            czk: # upper / lower code of currency is not important
                decimals: 3
                decimalPoint: '.'
                thousandsSeparator: ','
                zeroIsEmpty: TRUE
                emptyValue: '-'
                zeroClear: TRUE
                mask: '1U'
                showUnit: FALSE 
                nbsp: TRUE
                unit: 
                intOnly: -1 # -1 is default value
                
            usd:
                unit: '$'
            gbp: [] # use default format 
            foo: null # disable
    driver: # string class of h4kuna\Exchange\Driver\Driver default is Cnb\Day
    session: false # save info about currencies to session, default is only to cookie 
    vat: 21 # add number like percent
    strict: true # default enabled, download only defined currencies, example: ['CZK', 'EUR']
    defaultFormat: null # how format currency if format is not defined, value is array like above "currencies.czk" 
    managerParameter: 'currency' # is parameter for query, cookie and session if is available
    tempDir: %tempDir% # temporary directory for cache
    filters: # extension define frour filter for latte, you can rename
        currency: currency
        currencyTo: currencyTo
        vat: vat
        vatTo: vatTo

Latte

Now we have four new filters.

{=100|currency}
{=100|vat}
{=100|currencyTo}
{=100|vatTo}

Request

Create url with parameter currency and change value and check cookie.

/?currency=USD

No release at this moment. Try to create first one.

bar-chart-fill

Statistics

download-cloud-fill
1569
star-fill
1
bug-fill
1
flashlight-fill
11d
price-tag-2-line

Badges

guide-fill

Dependencies

Componette Componette felix@nette.org