Laravel 5.4:Ckeditor.js没有在视图上加载(blade.php)

时间:2017-02-22 09:24:19

标签: laravel ckeditor

我的脚本未在视图上加载ckeditor.js(file.blade.php)

详细说明:

My Laravel 5.4文件夹结构(部分)如下所示。

-example.com
----Ckeditor
-------ckeditor.js
----Public //this is the document root of example.com
----Resources
-------Views
----------file.blade.php

我在demo.blade.php上调用了ckeditor.js,就像这样...

方法1:

<script src="{{url('Ckeditor/ckeditor.js')}}"></script>

方法2:

<script src="http://example.com/Ckeditor/ckeditor.js"></script>

No Method在file.blade.php上加载ckeditor.js

我该怎么做?

1 个答案:

答案 0 :(得分:2)

将Ckeditor文件夹放入公共文件夹,并在视图中包含js,如:

<script src="{{asset('Ckeditor/ckeditor.js')}}"></script>

更多信息:https://laravel.com/docs/master/helpers#method-asset