sonata-project/SonataCoreBundle — pull request #7 by eko (2013-12-09 14:40:18+00:00)
Title: SONATA-259 - Add flash messages manager

I've added a `FlashManager` to handle bundles flash message types and turn them into "success", "warning" or "error".

So I can specify in my configuration the following rule:

```yml
sonata_core:
flashmessage:
success:
- a_bundle_success
```

And when I set a flash message like the following:

```php
$this->get('session')->getFlashBag()->set('a_bundle_success', 'Hey dude, this is a success message!');
```

I can retrieve it as a "success" message like this:

```php
$this->get('sonata.core.flashmessage.manager')
$messages = $flashManager->get('success');
```

or in my Twig template:

```twig
{% for message in sonata_flashmessages_get('success') %}

{{ message }}

{% endfor %}
```