Skip to content
This repository has been archived by the owner on Oct 23, 2018. It is now read-only.

merkle-open/TwigExtensionsBundle

Repository files navigation

TwigExtensionsBundle

Install TwigExtensionsBundle

Edit app/AppKernel.php and add a new entry to the $bundles array: public function registerBundles()

{
    $bundles = array(
        // ...
        new Terrific\TwigExtensionsBundle\TerrificTwigExtensionsBundle()
        // ...
    );
}

Register namespace in app/autoload.php:

$loader->registerNamespaces(array(
    // ...
    // 'Name' => __DIR__.'/path/to/parent/of/TwigExtensionsBundle/folder'
    'Terrific' => __DIR__.'/../vendor/bundles'
    // ...
));

Twig Extensions

Configure and add new Twig Extensions

Configuration (take a look at Service Conatiner if you want to read more about it) is done in file TwigExtensionsBundle\Resources\config\services.yml:

services:
    terrific.twig.extension.filler:
        class: Terrific\TwigExtensionsBundle\Twig\Extension\FillerExtension
        tags:
            - { name: twig.extension }

FillerExtension

Based on Naneau Text Filler by Maurice Fonk.

Usage:

{{ w(2) }} to get two single random words like "Lorem ipsum".

{{ p(2) }} to get two single random paragraphs like "Lorem ipsum dolor ..." paragraphs.

TextGeneratorExtension

Based on Mathew Tinsley's PHP Lorem Ipsum Script. Converted to a Twig Extension by Bruno Lorenz.

Usage:

{{ textgen(2) }} to get two randowm words like "lorem impsum." with period.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages