Notes
Flash messages
Content of the notes (2)
Page 1
basic:
Usage on controller
$this->addFlash(
'notice',
'Your changes were saved!'
);
Usage on template (html)
{% for message in app.flashes('notice') %}
<div class="flash-notice">
{{ message }}
</div>
{% endfor %}
Page 2
Another e.g.
Usage on controller
$this->addFlash(
'warning',
'Your changes NOT saved!'
);
Usage on template (html)
{% for label, messages in app.flashes %}
{% for message in messages %}
<div class="flash-{{ label }}">
{{ message }}
</div>
{% endfor %}
{% endfor %}
Information
- Description
- How to display a Flash Messages on your code.
- Created by
- Elvis Moraes
- Views
- 43
- Tags
- Rating