2017 © Pedro Peláez
 

library twig-byte-units-extension

Twig filters that format output of units of information by using ByteUnits library by Gabriele Lana

image

marioblazek/twig-byte-units-extension

Twig filters that format output of units of information by using ByteUnits library by Gabriele Lana

  • Friday, June 8, 2018
  • by MarioBlazek
  • Repository
  • 1 Watchers
  • 1 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Byte Units Twig extension

Build Status Code Coverage Downloads Latest stable License, (*1)

This package provides simple Twig filters that wrap ByteUnits lib by Gabriele Lana which makes manipulation with informational units very easy., (*2)

Installation

To install this extension, use Composer:, (*3)

composer require marioblazek/twig-byte-units-extension

Using the extension

In PHP:, (*4)

$twig = new Twig_Environment($loader, $options);

$twig->addExtension(new Marek\Twig\ByteUnitsExtension());

In a Symfony project, you can register the extension as a service:, (*5)

services:
    twig.extension.byte_units:
        class: Marek\Twig\ByteUnitsExtension
        tags:
            - { name: twig.extension }

Once set up, you can use the following Twig filters:, (*6)

  • 1322000|byte_units_format_metric('MB') - Returns value formated in MB as returned by ByteUnits\Metric::format method
  • 1322000|byte_units_format_binary('MB') - Returns value formated in MiB as returned by ByteUnits\Binary::format method
  • 1322000|byte_units_bytes_metric - Returns the number of bytes as string returned by ByteUnits\Metric::numberOfBytes method
  • 1322000|byte_units_bytes_binary - Returns the number of bytes as string returned by ByteUnits\Binary::numberOfBytes method

for more information please check formating section on byte-units repo., (*7)

The Versions

08/06 2018

dev-master

9999999-dev https://github.com/marioblazek/twig-byte-units-extension

Twig filters that format output of units of information by using ByteUnits library by Gabriele Lana

  Sources   Download

MIT

The Requires

 

The Development Requires

templating twig symfony package byte units of information

08/06 2018

v1.0.0

1.0.0.0 https://github.com/marioblazek/twig-byte-units-extension

Twig filters that format output of units of information by using ByteUnits library by Gabriele Lana

  Sources   Download

MIT

The Requires

 

The Development Requires

templating twig symfony package byte units of information