2017 © Pedro Peláez
 

symfony-bundle twig-extension-bundle

Symfony bundle with useful twig extensions

image

rdrenth/twig-extension-bundle

Symfony bundle with useful twig extensions

  • Friday, July 22, 2016
  • by rdrenth
  • Repository
  • 1 Watchers
  • 1 Stars
  • 2,089 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 5 % Grown

The README.md

RdrenthTwigExtensionBundle

Build Status Latest Stable Version Total Downloads Latest Unstable Version License SensioLabsInsight, (*1)

About

This is a Symfony2 Bundle that provides you with some extensions to Twig!, (*2)

Twig extensions

Stringy

This extension provides the following filters (provided by the Stringy package)., (*3)

For more information about each filter, please check the links., (*4)

ascii

{{ 'fòôbàř'|ascii }} {# foobar #}

camelize

{{ 'Camel-Case'|camelize }} {# camelCase #}

dasherize

{{ 'fooBar'|dasherize }} {# foo-bar #}

delimit

{{ 'fooBar'|delimit('::') }} {# foo::bar #}

humanize

{{ 'author_id'|humanize }} {# Author #}

slugify

{{ 'Using strings like fòô bàř'| slugify }} {# using-strings-like-foo-bar #}

titleize

{{ 'i like to watch television'|titleize(['to']) }} {# I Like to Watch Television #}

underscored

{{ 'TestUCase'|underscored }} {# test_u_case #}

lcfirst

{{ 'LowerCaseFirst'|lcfirst }} {# lowerCaseFirst #}

ucfirst

{{ 'upperCaseFirst'|ucfirst }} {# UpperCaseFirst #}

Installation

Step 1: Install RdrenthTwigExtensionBundle using Composer

$ composer require rdrenth/twig-extension-bundle

Step 2: Enable the bundle

<?php

// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new Rdrenth\Bundle\TwigExtensionBundle\RdrenthTwigExtensionBundle(),
        // ...
    );
}

Step 3: Configure your config.yml file

By default the filters are disabled, enable the filters you want to use like this:, (*5)

# app/config/config.yml

rdrenth_twig_extension:
    stringy:
        filters:
            ascii: ~
            camelize: ~

It is also possible to modify the filter name that is being used in Twig:, (*6)

# app/config/config.yml

rdrenth_twig_extension:
    stringy:
        filters:
            camelize:
                filter: camels

Or provide extra filters which are not available by default from the Stringy package (the method has to exist in the Stringy class):, (*7)

# app/config/config.yml

rdrenth_twig_extension:
    stringy:
        extra_filters:
            - { filter: swap_case, method: swapCase }

License

This bundle is under the MIT license. See the complete license in the bundle:, (*8)

Resources/meta/LICENSE

The Versions

22/07 2016

dev-develop

dev-develop https://github.com/rdrenth/twig-extension-bundle

Symfony bundle with useful twig extensions

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ronald Drenth

twig bundle symfony twig extension stringy rdrenth

22/07 2016

dev-master

9999999-dev https://github.com/rdrenth/twig-extension-bundle

Symfony bundle with useful twig extensions

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ronald Drenth

twig bundle symfony twig extension stringy rdrenth

22/07 2016

1.1.0

1.1.0.0 https://github.com/rdrenth/twig-extension-bundle

Symfony bundle with useful twig extensions

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ronald Drenth

twig bundle symfony twig extension stringy rdrenth

23/12 2015

1.0.3

1.0.3.0 https://github.com/rdrenth/twig-extension-bundle

Symfony bundle with useful twig extensions

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ronald Drenth

twig bundle symfony twig extension stringy rdrenth

04/12 2015

1.0.2

1.0.2.0 https://github.com/rdrenth/twig-extension-bundle

Symfony bundle with useful twig extensions

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ronald Drenth

twig bundle symfony twig extension stringy rdrenth

22/11 2015

1.0.1

1.0.1.0 https://github.com/rdrenth/twig-extension-bundle

Symfony bundle with useful twig extensions

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ronald Drenth

twig bundle symfony twig extension stringy rdrenth

20/11 2015

1.0.0

1.0.0.0 https://github.com/rdrenth/twig-extension-bundle

Symfony bundle with useful twig extensions

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ronald Drenth

twig bundle symfony twig extension stringy rdrenth