【问题标题】:CKEditor ignoring BASEPATH in LaravelCKEditor 忽略 Laravel 中的 BASEPATH
【发布时间】:2016-01-15 19:24:00
【问题描述】:

在 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.pluginsbasePath 属性?或者添加像CKEDITOR.plugins.addExternal('someNameForThePlugin', CKEDITOR_BASEPATH + '/js/ckeditor/', 'scriptFile.js') 这样的外部资源,然后将其作为额外插件添加到编辑器配置中?检查这个:ckeditor.com/forums/CKEditor-3.x/…

标签: javascript php laravel-5 ckeditor ckfinder


【解决方案1】:

我在使用 laravel 和 CKEditior 时遇到了类似的问题。

不同之处在于我在插件文件夹中遇到了这个问题,以提供我的自定义按钮的图标

icon: this.path + 'mypath'

解决了我的问题。

因此您可能还必须在this.path 之后附加您的路径

希望它也能解决你的问题。

【讨论】:

    【解决方案2】:

    使用 Symfony-2 laravel5 作曲家

    【讨论】:

      【解决方案3】:

      您必须将完整地址写入文件文件

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

      【讨论】:

      • 尝试用相对的 ../../public/js/plugins 指向目录
      猜你喜欢
      • 2015-06-21
      • 1970-01-01
      • 2016-07-24
      • 1970-01-01
      • 2016-10-29
      • 1970-01-01
      • 1970-01-01
      • 2017-01-30
      • 1970-01-01
      相关资源
      最近更新 更多