Created
August 27, 2015 14:06
-
-
Save micronax/2a86bd7b1e9c28944b2c to your computer and use it in GitHub Desktop.
Symfony 2 flash best-practice template for Twitter Bootstrap based Layouts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for type, flashes in app.session.flashbag.all %} | |
{% for flash in flashes %} | |
<div class="row"> | |
<div class="col-lg-12"> | |
<div class="alert alert-{{ type }}"> | |
<button class="close" data-dismiss="alert" type="button">×</button>{{ flash }} | |
</div> | |
</div> | |
</div> | |
{% endfor %} | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// Usage in Controller Actions: | |
$this->addFlash('success', 'Your registration was successful!'); | |
$this->addFlash('warning', 'This email addres is already registered!'); | |
$this->addFlash('danger', 'Your account is currentl locked!'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment