Created
July 21, 2013 04:53
-
-
Save serapheem/6047527 to your computer and use it in GitHub Desktop.
Symfony2 - Getting Flash message in template
This file contains hidden or 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
| Twig: | |
| {% if app.session.hasFlash('notice') %} | |
| <div class="flash-notice"> | |
| {{ app.session.flash('notice') }} | |
| </div> | |
| {% endif %} | |
| PHP: | |
| <?php if ($view['session']->hasFlash('notice')): ?> | |
| <div class="flash-notice"> | |
| <?php echo $view['session']->getFlash('notice') ?> | |
| </div> | |
| <?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment