minetro/latte-formatter

This package is abandoned and no longer maintained. The author suggests using the contributte/latte package instead.

Simple string formatter for Latte

1.0.0 2015-04-22 13:50 UTC

README

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)