Skip to content
Twig extension for rendering slim flash messages
Branch: master
Clone or download
Latest commit 919e9d6 Jan 29, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src change namespace Jan 20, 2016
tests fix test Jan 29, 2018
.gitattributes export-ignore composer.phar, composer.lock, .travis.yml Jan 20, 2016
.gitignore Basic features Jan 20, 2016
.travis.yml Basic features Jan 20, 2016
LICENSE Initial commit Jan 19, 2016
README.md fix issue #1 Dec 3, 2016
composer.json fix test Jan 29, 2018
composer.lock update composer.json Jan 29, 2018
composer.phar Basic features Jan 20, 2016
phpunit.xml.dist Removed 2 warnings from tests Dec 29, 2016

README.md

Slim Twig Flash

A Twig extension to access Slim Flash messages in templates.

master develop
Build Status Build Status

Install

Via Composer

composer require kanellov/slim-twig-flash

Requires:

  • PHP 5.5.0 or newer
  • Slim Framework Flash Messages 0.1.0 or newer
  • Twig 1.18.0 or newer

Usage

  • Add extension to your twig view
...
$view->addExtension(new Knlv\Slim\Views\TwigMessages(
    new Slim\Flash\Messages()
));
...
  • In templates use flash() or flash('some_key') to fetch messages from Flash service
...
<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.

You can’t perform that action at this time.