voilab/slim-extensions

Some Slim extensions made by Voilab.

1.1.3 2017-02-14 20:36 UTC

This package is not auto-updated.

Last update: 2024-11-21 22:10:41 UTC


README

Simple extension for Twig and Slim.

Shamelessly based on Slim-Views by Josh Lockhart and Andrew Smith.

How to Install

using Composer

Create a composer.json file in your project root:

{
    "require": {
        "voilab/slim-extensions": "0.1.*"
    }
}

Then run the following composer command:

$ php composer.phar install

Twig

$view->parserExtensions = array(
    new \Voilab\Slim\Views\TwigExtension(),
);

rootUri

Inside your Twig template you would write:

{{ rootUri() }}

Authors

Alexandre Ravey

License

MIT Public License