Notas
Flash messages
Conteúdo das notas (2)
Página 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 %}
Página 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 %}
Informações
- Descrição
- How to display a Flash Messages on your code.
- Criado por
- Elvis Moraes
- Visualizações
- 43
- Tags
- Avaliação