Topic: Alert component
Pierre Dommerc
pro
asked 6 years ago
{% if error %}
// display the alert message
{% endif %}
I think I have to use Jquery for automaticaly display the alert. But I need help for this.
thanks !
Pierre Dommerc
pro
answered 6 years ago
{% for flash_message in app.session.flashBag.get('notice') %}
<script>
$( document ).ready(function() {
toastr.success('{{ flash_message }}');
});
</script>
{% endfor %}
Pierre Dommerc
pro
answered 6 years ago
{% for flash_message in app.session.flashBag.get('notice') %}
{{ flash_message }}
{% endfor %}
And flash_message is a variable of string type.
Can you help me ?
Bartłomiej Malanowski
staff
answered 6 years ago
{% if error %}
<script type="text/javascript">
$(document).ready() {
toastr.error('Error');
}
</script>
{% endif %}
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No