sk / twig-extensions-bundle
Some useful twig extensions
Installs: 87
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- symfony/framework-bundle: ^2.7 || ^3.0
- symfony/twig-bundle: ^2.7 || ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.0
- php-coveralls/php-coveralls: ^2.0
- phpunit/phpunit: ~4.8|~5.0
- symfony/phpunit-bridge: ^2.7 || ^3.0
- symfony/routing: ^2.7 || ^3.0
Suggests
- symfony/routing: Needed when using RoutingExtraTwigExtension
README
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
- Format Extension
- Filter
- Functions
- Routing Extra Extension
- Functions
- Util Extension
- String Extension
License
This bundle is under the MIT license. See the complete license in the bundles LICENSE file.