2017 © Pedro Peláez
 

symfony-bundle php-units-of-measure-bundle

Symfony PhpUnitsOfMeasureBundle

image

triplepoint/php-units-of-measure-bundle

Symfony PhpUnitsOfMeasureBundle

  • Wednesday, October 15, 2014
  • by tiagobrito
  • Repository
  • 2 Watchers
  • 3 Stars
  • 45 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 5 % Grown

The README.md

PhpUnitsOfMeasureBundle

The PhpUnitsOfMeasureBundle provides integration of the php-units-of-measure library into the Symfony2 framework., (*1)

Features:

Twig filter list

  • um_acceleration
  • um_angle
  • um_area
  • um_electric_current
  • um_length
  • um_luminous_intensity
  • um_mass
  • um_pressure
  • um_temperature
  • um_velocity
  • um_volume

Installation and configuration:

Add PhpUnitsOfMeasureBundle to your application kernel

``` php <?php, (*2)

// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Triplepoint\PhpUnitsOfMeasureBundle\TriplepointPhpUnitsOfMeasureBundle(),
        // ...
    );
}

```, (*3)

Usage examples:

Twig extensions examples

Convert filters :, (*4)

  • {{ '5000' | um_length('m', 'km') }} convert 5000 meters to 5 kilometers, (*5)

  • {{ '0.5' | um_acceleration }} convert 0.5 m/s2 to 6480 km/h2 using the default units, (*6)

Future work:

  • Allow overriding measure classes

The Versions

15/10 2014

dev-master

9999999-dev https://github.com/tiagobrito/PhpUnitsOfMeasureBundle

Symfony PhpUnitsOfMeasureBundle

  Sources   Download

The Requires

 

by Tiago Brito

convert measure units