GithubHelp home page GithubHelp logo

exchange-nette's Introduction

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 

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 
    
    session: [FALSE] # save info about currencies to session, default is only to cookie
    vat: [0] # 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
    tempDir: /tmp # temporary directory for cache
    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

exchange-nette's People

Contributors

h4kuna avatar spernica avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.