【问题标题】:Laravel toastr message not workingLaravel toastr 消息不起作用
【发布时间】:2017-06-10 13:49:45
【问题描述】:

Laravel toastr 消息不工作

我已添加包"nilsenj/toastr-5.1-laravel": "dev-master"

我已经添加了 CSS 和 JS

<link type="text/css" rel="stylesheet" 
  href="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.css">
<script 
  src="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js">
</script>

并且在控制器中我添加了类似

的消息
Toastr::success('Messages in here', 'Title', 
        ["positionClass" => "toast-top-center"]);

toastr 消息 不显示。

【问题讨论】:

  • 您收到任何错误/警告??

标签: php laravel toastr


【解决方案1】:

您是否在主模板(视图)中添加了这个?

{!! Toastr::render() !!}

【讨论】:

  • 是的,我已经添加了这个,但仍然无法正常工作,并且我使用了名称空间,例如 use nilsenj\Toastr\Facades\Toastr;
  • 如果我们重定向页面然后workign。否则不工作
猜你喜欢
  • 2021-02-08
  • 2015-07-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多