CodeIgniter(1.6.3)安装FCKeditor插件
来源:互联网 发布:php 加密解密函数 编辑:程序博客网 时间:2024/05/22 14:33
1. 下载解压FCKeditor 2.6.3,我是放在system/application/plugins/fckeditor/ 下。
2.根据你的php版本,将fckeditor_php4.php或fckeditor_php5.php复制到 /system/application/libraries/ 下,并更名为 fckeditor.php
3. 打开此文件,将类名更改为 Fckeditor,并修改你的构造器 // PHP 5
function __construct( $instanceName )
{
$this->InstanceName = $instanceName ;
$this->BasePath = '/fckeditor/' ;
$this->Width = '100%' ;
$this->Height = '200' ;
$this->ToolbarSet = 'Default' ;
$this->Value = '' ;
$this->Config = array() ;
}
// PHP 4
function Fckeditor( $instanceName )
{
$this->__construct( $instanceName ) ;
}
4. 打开 ./system/application/libraries/下的 fckeditor.php,复制FCKeditor_IsCompatibleBrowser()函数里的所有内容,替换到IsCompatible()函数里的所有内容
5. 修改 ./system/application/libraries/fckeditor.php 的 constructor 里的 basepath 定义
$this->BasePath = base_url().'system/application/plugins/fckeditor/' ;
6.如果你使用了.htaccess文件,需要做如下修改
RewriteCond $1 !^(index/.php|images|system/application/plugins/fckeditor)
$this->load->library('fckeditor','content');
$this->fckeditor->ToolbarSet = 'Basic';
$data['fckeditor']=$this->fckeditor->CreateHtml();
在view里用 <?=$fckeditor?>就可以了
8.如果要在一个页面显示多个fckeditor
$this->load->library('fckeditor', 'FCKEDITOR1');
$this->fckeditor->BasePath = 'system/plugins/FCKeditor/';
$this->fckeditor->ToolbarSet = 'Basic';
$data['fck1'] = $this->fckeditor->CreateHtml();
$this->fckeditor->InstanceName = 'FCKEDITOR2';
$data['fck2'] = $this->fckeditor->CreateHtml();
$this->load->view('mypage', $data);
在服务器端,可以这样:
$first_box = $this->input->post('FCKEDITOR1');
$second_box = $this->input->post('FCKEDITOR2');
其他的一些配置,你可以在fckconfig.js中自己修改
OK!生活就是这样美好。。
时代在发展,Codeigniter1.7.0安装新版本fck会遇到一些麻烦
CI 1.7.0安装FCKeditor2.6.x bug修复方法
如果你使用的是CodeIgniter1.7.0,常规方法可能会产生如下警告Severity: Warning
Message: Missing argument 1 for Fckeditor::__construct(), called in systemlibrariesLoader.php on line 931 and defined
Filename: libraries/fckeditor.php
Line Number: 130
2.
Severity: Notice
Message: Undefined variable: instanceName
Filename: libraries/fckeditor.php
Line Number: 132
1) 在控制器中,按照如下方法加载fckeditor,并传给其构造函数一个数组参数:
$this->load->library('fckeditor',array('instanceName' => 'content'));
{
$this->InstanceName = $array['instanceName'] ;
.....
.....
}
- CodeIgniter(1.6.3)安装FCKeditor插件
- MediaWiki安装FCKeditor可视化编辑器插件
- CodeIgniter 安装
- CodeIgniter 里集成 FCKeditor 的方法
- FCKeditor安装:
- FCKeditor插件开发
- fckeditor 插件参考一
- FckEditor,远程图片下载,插件
- rails之FCKEditor插件
- FCKeditor flv插件
- 使用fckeditor插件
- FCKeditor插件开发
- FCKeditor 插件开发
- Fckeditor插件的使用
- 安装使用CodeIgniter
- CodeIgniter安装指导
- CodeIgniter框架安装
- 四步来安装 CodeIgniter
- 终身受益的十个WORD技巧
- vs2005连接时出错拉 无法解析的外部符号 _main,该符号在函数 ___tmainCRTStartup 中被引用
- 瀑布模型 迭代模型
- 架设FTP
- Unobtrusive JavaScript 的七条规则
- CodeIgniter(1.6.3)安装FCKeditor插件
- 敏捷开发
- Union和Struct
- AbstractFactroy(C#)(抽象工厂)(设计模式)
- 做软件赚钱吗?
- c++编写职员信息(姓名排序)的类
- 收集整理18项技能之冲突管理(1)
- 设置Mysql连接数
- 打球,很久没打球了