有没有一种方法可以将js Notification与set_flashdata codeigniter一起使用


Is there a way to use js Notification with set_flashdata codeigniter?

使用Codeigniter 3

我是个初学者。

我尝试了越来越多通知风格$this->session->set_flashdata('', '')的灵感,但我失败了。当我放置闪存数据$this->session->flashdata('messagename') 时,我不知道如何在js中调用show通知方法

使用这个简单的烤面包机,而不是使用外部烤面包机。

Html代码

<div class="toast toast-default">
    <button class="toast-dismiss"><i class="fa fa-times"></i></button>
        Oops!!! Something went wrong while adding this product. Please try again after sometime.
</div>

Css

.toast-default {
    background: rgba(53, 164, 178, 0.8) none repeat scroll 0 0;
    color: #fff;
}
.toast {
    border-radius: 5px;
    display: none; <--- if flashdata is set make it block.
    padding: 20px 10px 10px;
    position: fixed;
    right: 20px;
    top: 100px;
    width: 250px;
    z-index: 1000;
}

默认情况下,tost为display none。

如果设置了flash数据,则将其设为显示块。