menu

开发进行时...

crazy coder

Avatar

codeigniter集成CKEditor

codeigniter1.7.2
CKEditor 3.2.1

将ckeditor解压到system/plugins下,即system/plugins/ckeditor
下载http://www.kromack.com/files/ckeditor_helper.zip
解压到system/application/helpers目录
CKEditor配置参数http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Setting_Configurations
CKEditor自定义样式
http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Styles
将\system\plugins\ckeditor\ckeditor_php5.php拷贝为\system\application\libraries\ckeditor.php

load library:

<?php
class Content extends MY_Controller {

    function Content() {
        parent::MY_Controller();
    }

    function index() {
        $this->load->library('ckeditor',base_url() . 'system/plugins/ckeditor/');
        $this->ckeditor->basePath = base_url(). 'system/plugins/ckeditor/';
        $this->ckeditor->ToolbarSet = 'Basic';
    } 

put the editor in the view


<?=form_open("content")?>
<table width="100%" cellpadding="0" cellspacing="0">
    <tr>
        <td><?=$this->ckeditor->editor("editor1","initial value");?></td>
    </tr>
</table>
<?=form_close()?> 

http://codeigniter.com/wiki/CKEditor/
http://www.kromack.com/codeigniter/ckeditor-helper-for-codeigniter/

为什么我操作不成功呢???