码迷,mamicode.com
首页 > 其他好文 > 详细

laracasts/flash

时间:2015-09-14 22:27:50      阅读:473      评论:0      收藏:0      [点我收藏+]

标签:

一个flash消息的插件

  1. composer require laracasts/flash

     

  2. config\app.php
    //provider
    ‘Laracasts\Flash\FlashServiceProvider‘
    //aliases
    ‘Flash‘  => ‘Laracasts\Flash\Flash‘

     

  3. 视图blade中调用
    @include(‘flash::message‘)
    <script src="//cdn.bootcss.com/jquery/3.0.0-alpha1/jquery.min.js"></script>
    <script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <script type="text/javascript">
         //modal框样式
             $(#flash-overlay-modal).modal();
            //或者普通样式
        $(div.alert).not(.alert-important).delay(3000).slideUp(300);
    </script>

     

  4. 控制器调用,两种区别只是颜色不同而已
            flash(Your article has been created!);
            flash()->success(Your article has been created!);
         //使用modal
    flash()->overlay(‘Your article has been created!‘,‘Good Job‘);

     

laracasts/flash

标签:

原文地址:http://www.cnblogs.com/fenle/p/4808213.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!