将文件浏览器集成到ckeditor&;CakePHP

将文件浏览器集成到ckeditor&;CakePHP,cakephp,file-upload,cakephp-1.3,ckeditor,Cakephp,File Upload,Cakephp 1.3,Ckeditor,最近在中找到一篇文章,介绍如何将文件浏览器集成到ckeditor(的文件管理器) 我按照步骤操作,但单击“浏览服务器”按钮时出错 缺少控制器: 错误:找不到CkeditorController。如果它尝试查找控制器,这意味着它无法访问编辑器文件或文件夹,而是CakePHP的调度程序获取请求并尝试加载fckeditor控制器 这意味着您需要将编辑器放在正确的目录中(例如app/webroot/fckedtor/)或使用正确的url访问它。在安装过程中,我遇到了相同的错误,但我似乎不记得是什么错误以

最近在中找到一篇文章,介绍如何将文件浏览器集成到ckeditor(的文件管理器)

我按照步骤操作,但单击“浏览服务器”按钮时出错

缺少控制器:
错误:找不到CkeditorController。

如果它尝试查找控制器,这意味着它无法访问编辑器文件或文件夹,而是CakePHP的调度程序获取请求并尝试加载fckeditor控制器


这意味着您需要将编辑器放在正确的目录中(例如app/webroot/fckedtor/)或使用正确的url访问它。

在安装过程中,我遇到了相同的错误,但我似乎不记得是什么错误以及如何修复它。如果我的下一个解决方案无法解决您的问题,请告知我,我将进一步调查:

  • 首先,我遵循了下面的教程,该教程运行良好,但错过了身份验证部分:
  • 然后我使用了您引用的教程,除了提供的最后一段代码。相反,我将以下代码直接添加到我的查看页面:
    admin\u add.ctp

    <?php echo $form->textarea('body', array(/*'class'=>'ckeditor', */'id' => 'body', 'class' => 'body')) ?>
    <?php
        include_once 'ckeditor/ckeditor.php' ;
        //require_once 'ckfinder/ckfinder.php' ;
        //$initialValue = 'Default value goes here' ;
        $ckeditor = new CKEditor() ;
        $ckeditor->basePath = '/ckeditor/' ;
        $ckeditor->config['filebrowserBrowseUrl'] = '/ckeditor/filemanager/index.html';
        $ckeditor->config['filebrowserUploadUrl'] = '/ckeditor/filemanager/connectors/php/filemanager.php';
        $ckeditor->config['filebrowserImageBrowseUrl'] = '/ckeditor/filemanager/index.html?type=Images';
        $ckeditor->config['filebrowserImageUploadUrl'] = '/ckeditor/filemanager/connectors/php/filemanager.php?command=QuickUpload&type;=Images';
    
        $ckeditor->config['filebrowserWindowWidth'] = '800';
        //CKFinder::SetupCKEditor( $ckeditor,'/ckfinder/' ) ;
    
                // This will replace CakePHP textarea listed above.
        $ckeditor->replace('body');
    ?>
    

    您以前是否将CKeditor与Cake集成?该教程仅适用于文件浏览器。谢谢您的代码,但我还必须在config.js中更改为完整路径。。对此。。。config.filebrowserImageBrowseUrl='/blog2/app/webroot/js/ckeditor/Filemanager/index.html?type=Images';嘿我这个周末刚把我的应用程序放到网上,我还注意到我不得不把你上面提到的代码部分改成完整路径,可能是因为它是一个共享主机。不管怎样,我很高兴我能帮上忙。。。CakePHP规则!
    function auth() {
        session_name("CAKEPHP");
        session_start();
        if(isset($_SESSION['Auth']['User']) )
        {
            //Since CKEditor for me is only used in the admin section
            //I make sure only admins can access it, group_id=1
            if($_SESSION['Auth']['User']['group_id'] == 1)
            {
                return true;
            }
        }
        return false;
    }