2017 © Pedro Peláez
 

library twig-inflect

TwigInflect is a Twig extension to transform the inflection of strings.

image

joshuabaker/twig-inflect

TwigInflect is a Twig extension to transform the inflection of strings.

  • Tuesday, August 4, 2015
  • by joshuabaker
  • Repository
  • 1 Watchers
  • 0 Stars
  • 83 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

TwigInflect

TwigInflect is a Twig extension to transform the inflection of strings., (*1)

The extension adds the following filters: - pluralize - singularize - camelize - dasherize - humanize - hyphenate - ordinalize - pascalize - titleize - underscore, (*2)

--, (*3)

Installation

{
    "require": {
        "joshuabaker/twig-inflect": "dev-master"
    }
}
<?php

use JoshuaBaker\Twig\Extensions\Extension\Inflect as TwigInflect;

$loader = new Twig_Loader_Filesystem('/path/to/templates');
$twig   = new Twig_Environment($loader);

// Registers extension
$twig->setExtensions(new TwigInflect);

--, (*4)

Usage

{{ 'car' | pluralize }}
{{ 'car' | pluralize(3) }}
{# cars #}

{{ 'bikes' | pluralize(1) }}
{{ 'bikes' | singularize }}
{# bike #}

The Versions

04/08 2015

dev-master

9999999-dev

TwigInflect is a Twig extension to transform the inflection of strings.

  Sources   Download

The Requires

 

by Josh Baker

twig template extension inflector transform string inflect inflection underscore humanize singularize pluralize hyphenate camelize dasherize ordinalize pascalize titleize

04/08 2015

1.0.0-beta.1

1.0.0.0-beta1

TwigInflect is a Twig extension to transform the inflection of strings.

  Sources   Download

The Requires

 

by Josh Baker

twig template extension inflector transform string inflect inflection underscore humanize singularize pluralize hyphenate camelize dasherize ordinalize pascalize titleize