Exchange between currencies.

v0.5.0 2024-02-15 08:08 UTC

This package is auto-updated.

Last update: 2024-04-15 08:30:23 UTC


Downloads this Month Latest Stable Version Coverage Status Total Downloads License

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


Simple via composer

composer require h4kuna/exchange-nette

optional dependencies

composer require h4kuna/exchange-nette guzzlehttp/guzzle malkusch/lock nette/application nette/caching


First step is registration extension and set tempDir.

    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.


Format options for currency read h4kuna/number-format

            czk: # upper / lower code of currency is not important
                decimals: 3
                decimalPoint: '.'
                thousandsSeparator: ','
                zeroIsEmpty: true
                emptyValue: '-'
                zeroClear: true
                mask: '1U'
                showUnitIfEmpty: false 
                nbsp: true
                round: h4kuna\Format\Number\Round::BY_CEIL
                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


Now we have four new filters.



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