[DEPRECATED] Simple string formatter for Latte
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
tests
.gitattributes
.gitignore
.travis.yml
composer.json
readme.md

readme.md

Latte-Formatter

Simple string formatter for Latte.


Build Status Downloads total Latest stable HHVM Status

Discussion / Help

Join the chat

Install

$ composer require minetro/latte-formatter:~1.0.0

Usage

Register in config

Register in your config file (e.q. config.neon).

services:
    formatter.money: 
        class: Minetro\Formatter\NumberFormatter('Kc')
        
    formatter.weight: 
        class: Minetro\Formatter\NumberFormatter('kg', '~')
        setup:
            - setThousand(NULL)
            - setDecimal(0)
    
    nette.latteFactory:
        setup:
            - addFilter(money, [@formatter.number,format])
            # or
            - addFilter(money, @formatter.number::format)