简体   繁体   English

CKEditor在Laravel中忽略了BASEPATH

[英]CKEditor ignoring BASEPATH in Laravel

Installed CKEditor and CKFinder in a Laravel project, both in the Public/js folder 在Laravel项目中安装CKEditor和CKFinder,两者都在Public / js文件夹中

In my main page, I load a site specific .js file which contains 在我的主页面中,我加载了一个包含的特定于站点的.js文件

var CKEDITOR_BASEPATH = '/js/ckeditor/';

Also tried: 还尝试过:

var CKEDITOR_BASEPATH = 'http://localhost:8888/js/ckeditor/';

Then I load my ckeditor.js file 然后我加载我的ckeditor.js文件

From my /Resources/Views/admin/newpage.blade.php view, I load up a text box and call CKEditor.replace(). 从我的/Resources/Views/admin/newpage.blade.php视图中,我加载一个文本框并调用CKEditor.replace()。 Does it perfectly. 它完美吗? I can add a new page, even edit them. 我可以添加新页面,甚至可以编辑它们。

Problem occurs when I try to use the Browse server buttons, it tries to load the plugin from /admin/ckeditor/plugins/... instead of /js/ckeditor/plugins/... 当我尝试使用浏览服务器按钮时出现问题,它尝试从/ admin / ckeditor / plugins / ...而不是/ js / ckeditor / plugins / ...加载插件

I have a feeling its something simple I am missing, but just not sure what. 我有一种感觉,我想念的东西很简单,但不知道是什么。 Any thoughts? 有什么想法吗?

you have to write full address to file file this 你必须写完整地址到文件文件

<script>
  window.CKEDITOR_BASEPATH = 'http://example.com/path/to/libs/ckeditor/';
</script>

使用Symfony-2 laravel5作曲家

I had a similar issue with laravel and CKEditior. 我和laravel和CKEditior有类似的问题。

The difference is I was facing this in plugin folder to give the icon of my custom button 区别在于我在插件文件夹中面对这个,给出了我的自定义按钮的图标

icon: this.path + 'mypath'

solved my issue. 解决了我的问题。

So you may also have to append your path after this.path 所以你可能还需要在this.path之后追加你的路径

Hope it will sove yours too. 希望它也会刺激你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM