|
本帖最后由 keeponac 于 2010-11-3 23:28 编辑
下文中CI的根目录,记作CI_Home。
1.CI_Home下建立plugins目录,解压缩fckeditor。fckeditor根目录为 CI_Home/plugins/fckeditor。
2.修改CI_Home/plugins/fckeditor/editor/filemanager/connectors/php/config.php
$Config['Enabled'] = true ;
$Config['UserFilesPath'] = '../../../../../../images/' ;
3.将CI_Home/plugins/fckeditor/editor/fckeditor_php5.php,复制到CI_Home/system/application/libraries/或CI_Home/system/libraries/,改名为fckeditor.php,修改__construct。
public function __construct( )
{
$this->InstanceName = '';
$this->BasePath = base_url() .'plugins/fckeditor/' ;
$this->Width = '100%' ;
$this->Height = '200' ;
$this->ToolbarSet = 'Default' ;
$this->Value = '';
$this->Config = array() ;
}
4.控制器里
$this->load->library('fckeditor');
$this->fckeditor->InstanceName = 'description';
$data['fckeditor']=$this->fckeditor->CreateHtml();
注意,加载库传参数要传数组。
5.视图里
<?= $fckeditor?>
此方法在Linux,Apache测试通过。 |
|