sk/twig-extensions-bundle

Some useful twig extensions

1.2.2 2018-06-21 08:26 UTC

This package is auto-updated.

Last update: 2024-04-07 00:48:25 UTC


README

Build Status SensioLabsInsight Coverage Status

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require sk/twig-extensions-bundle

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new SK\TwigExtensionsBundle\SKTwigExtensionsBundle(),
        );

        // ...
    }

    // ...
}

Step 3: Activate the extensions you want

By default all extensions are disabled. But you can easily activate the extensions you want:

sk_twig_extensions:
    extensions:
        format_extension: true
        routing_extra_extension: true
        util_extension: true
        string_extension: true

What you will get

You will get a short set of useful and handy twig functions and filter. For more information and examples follow the links.

Included Extensions

License

This bundle is under the MIT license. See the complete license in the bundles LICENSE file.