在 Laravel 项目中安装了 CKEditor 和 CKFinder,都放置于 Public/js 文件夹下。
在我的主页面中,我加载一个特定于网站的 .js 文件,其中包含:
var CKEDITOR_BASEPATH = '/js/ckeditor/';
尝试过:
var CKEDITOR_BASEPATH = 'http://localhost:8888/js/ckeditor/';
然后我加载我的 ckeditor.js 文件。
从我的 /Resources/Views/admin/newpage.blade.php 视图中,我加载一个文本框并调用 CKEditor.replace()。它完美地工作。我可以添加新页面,甚至编辑它们。
问题是当我尝试使用浏览服务器按钮时,它会尝试从 /admin/ckeditor/plugins/... 而不是 /js/ckeditor/plugins/... 加载插件。
我感觉我错过了一些简单的东西,但不确定是什么。有什么想法吗?
CKEDITOR.plugins
的basePath
属性?或者添加了一个外部资源,例如CKEDITOR.plugins.addExternal('someNameForThePlugin', CKEDITOR_BASEPATH + '/js/ckeditor/', 'scriptFile.js')
,然后将其作为编辑器配置中的额外插件添加?请参考:http://ckeditor.com/forums/CKEditor-3.x/Tutorial-create-external-plugin-for-CKEDITOR - Alejandro Iván