Home

Awesome

Slim Twig Flash

A Twig extension to access Slim Flash messages in templates.

masterdevelop
Build StatusBuild Status

Install

Via Composer

composer require kanellov/slim-twig-flash

Requires:

Usage

...
$view->addExtension(new Knlv\Slim\Views\TwigMessages(
    new Slim\Flash\Messages()
));
...
...
<ul class="alert alert-danger">
    {% for msg in flash('error') %}
    <li>{{ msg }}</li>
    {% endfor %}
</ul>
...

Testing

phpunit

License

The GNU GENERAL PUBLIC LICENSE Version 3. Please see License File for more information.