There is a bootstrap template and in this template it is possible to use pop-up notifications, as well as instructions for use, but unfortunately I don’t understand how to run this notification using php, i.e. exactly at the moment when you need it.

Here is the instruction that is written in the template:

Command: toastr["success"]("Действие успешно", "Выполнено!") toastr.options = { "closeButton": false, "debug": false, "newestOnTop": false, "progressBar": false, "positionClass": "toast-top-right", "preventDuplicates": false, "onclick": null, "showDuration": "300", "hideDuration": "1000", "timeOut": "5000", "extendedTimeOut": "1000", "showEasing": "swing", "hideEasing": "linear", "showMethod": "fadeIn", "hideMethod": "fadeOut" } 

How can I run this notification in a similar example:

 if(TRUE){ print "Всплывающее уведомление"; } 

    1 answer 1

     <?php if(true) : ?> <script type="text/javascript"> showNotification(); </script> <?php endif; ?> 

    Try this

    • But where can I get showNotification () ;? I need to create this function and place this code in it - Command: toastr ["success"] ("Action successful", "Done!"), And also toastr.options? - Cinema Trailers
    • Well, I’ve given an example, and you already call your function as you wish. You create a function, put the code of your notification inside, and then, under certain conditions, call this function. - quaresma89