将KCFinder与Laravel 4一起使用

时间:2015-11-12 18:08:00

标签: laravel

有人可以指导我如何在L4中使用KCFinder吗? 我应该在哪里放置下载的KCFinder以及我应该做出哪些更改?

我无法理解这意味着什么:

CKEDITOR.editorConfig = function(config) {
// ...
   config.filebrowserBrowseUrl = '/kcfinder/browse.php?opener=ckeditor&type=files';
   config.filebrowserImageBrowseUrl = '/kcfinder/browse.php?opener=ckeditor&type=images';
   config.filebrowserFlashBrowseUrl = '/kcfinder/browse.php?opener=ckeditor&type=flash';
   config.filebrowserUploadUrl = '/kcfinder/upload.php?opener=ckeditor&type=files';
   config.filebrowserImageUploadUrl = '/kcfinder/upload.php?opener=ckeditor&type=images';
   config.filebrowserFlashUploadUrl = '/kcfinder/upload.php?opener=ckeditor&type=flash';
// ...
};

另外,为了设置会话,我发现了这个:

  

https://gist.github.com/frzsombor/ddd0e11f93885060ef35

但是我无法确定将包装放在哪里。我应该把它放在公共目录中吗? 请帮忙。

1 个答案:

答案 0 :(得分:0)

Laravel 4.2

在您的视图页面中,输入以下代码

<textarea name="ckeditor_id" id="ckeditor_id" ></textarea>

下面是我放置插件kcfinder文件夹

的路径
{{ URL::asset('/theme/metronic_one_v_4/global/plugins/kcfinder/') }}

然后

CKEDITOR.replace('ckeditor_id', {
    filebrowserBrowseUrl:"{{ URL::asset('/your_path_upto_plugin/browse.php?opener=ckeditor&type=files') }}",
    filebrowserImageBrowseUrl:"{{ URL::asset('/your_path_upto_plugin/browse.php?opener=ckeditor&type=images') }}",
    filebrowserFlashBrowseUrl:"    {{ URL::asset('/your_path_upto_plugin/browse.php?opener=ckeditor&type=flash') }}",
    filebrowserUploadUrl:"{{ URL::asset('/your_path_upto_plugin/upload.php?opener=ckeditor&type=files') }}",
    filebrowserImageUploadUrl:"{{ URL::asset('/your_path_upto_plugin/upload.php?opener=ckeditor&type=images') }}",
    filebrowserFlashUploadUrl:"{{ URL::asset('/your_path_upto_plugin/upload.php?opener=ckeditor&type=flash') }}",        
});

然后转到

kcfinder/conf/config.php

// GENERAL SETTINGS

'disabled' => false, <- set disable "false" Instade of "true"
'uploadURL' => "upload",
'uploadDir' => "",
'theme' => "default",

您的插件现在可以使用