Statistics
24
0
0
81d
Badges
Tags
latte

Exchange extension for Nette framework

Build Status Latest stable Downloads this Month

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

Instalation

Simple via composer

$ composer require h4kuna/exchange-nette

Registration

First step is registration extension and set tempDir.

extensions:
    exchangeExtension: h4kuna\Exchange\DI\ExchangeExtension

exchangeExtension:
    tempDir: %tempDir%/currencies   

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
                intOnly: NULL
                mask: '1U'
                showUnit: FALSE 
                nbsp: TRUE
                unit: Kč
                
            usd:
                unit: '$'
            gbp: [] # use default format 
    
    session: [FALSE] # save info about currencies to session, default is only to cookie
    vat: [NULL] # add number like percent, example: 21
    strict: [FALSE] # 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
    filters: # extension define two filter for latte, you can rename
        currency: currency
        vat: vat # if is set above via "vat"

Latte

Now we have two new filters.

{=100|currency}
{=100|vat}

Request

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

/?currency=USD

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

Is this addon outdated? Did you find an issue? Please report it.

Componette Componette admin@componette.com