cakephp2 中cteditor(fcteditor)
来源:互联网 发布:美工常用网站 编辑:程序博客网 时间:2024/05/19 02:18
cteditor版本ckeditor_3.6.3,
1、对解压后的ckeditor进行精简:去除多余的语言,除en,zh-cn,zh 去除例子,及源码,去除,asp
2、上传ckeditor到webroot/js/ckeditor
3、将ckeditor中php文件复制到Vendor文件夹
3、编写Fck助手:在view/helper/新建 FckHelper.php其内容如下:
<?php
App::import('Vendor', 'ckeditor');
class FckHelper extends AppHelper {
/**
* creates an fckeditor textarea
*
* @param array $namepair - used to build textarea name for views, array('Model', 'fieldname')
* @param stirng $basepath - base path of project/system
* @param string $content
*/
function Fckeditor($namepair = array(), $basepath = '', $content = array()){
$editor_name = 'data';
foreach ($namepair as $name){
$editor_name .= "[" . $name . "]";
}
$oFCKeditor = new CKEditor() ;
$oFCKeditor->basePath = $basepath . '/js/ckeditor/' ;
$oFCKeditor->config['width'] = "100%";
$oFCKeditor->config['height'] = "400";
$oFCKeditor->editor($editor_name, $content);
}
}
?>
4、对应contrllor中添加助手Fck;
5、view中用<?php echo $this->Fck->fckeditor(array('Article', 'content'),'','');?>article指model content指对应字段,第二个参数指响应路径,第三个为变量 添加文件时为空,编辑时为对应set回变量对应字段。
6、注意html转义问题
- cakephp2 中cteditor(fcteditor)
- cakephp2.0布局注意事项
- cakephp2 XML数据导入
- CAKEPHP2.0变化真大啊。
- CakePHP2命名规范
- cakephp2 MeioUpload 图片上传简单应用
- cakephp2.X 多表联查 join 使用分页
- 中
- 准备中学习中
- html中src中“../”
- 中投 汇金 中金 中登
- 烦恼中....
- 无聊中!
- 郁闷中。。。。。
- 挣脱中...
- 郁闷中....
- 郁闷中
- 屡败屡战中。。。。。。
- document.elements.length的一个bug
- 垃圾回收机制算法的前世今生
- Microsoft Sync Framework 系列(五):微软同步框架中的元数据(Metadata)
- 类型“string”必须是不可以为 null 值的类型才能用作泛型类型或方法“System.Nullable<T>”中的参数“T”
- Microsoft Sync Framework 系列(六):微软同步框架中的知识(Knowledge)
- cakephp2 中cteditor(fcteditor)
- CX51 用户手册----NOMODA2 伪指令
- nginx 源码学习笔记(四)
- Microsoft Sync Framework 系列(七):微软同步框架中的参与者(participants)
- 博客声明
- SQL Server ——视图
- 诗歌rails之 Delegate
- Lady GaGa - Paparazzi 歌词(中英文对照)
- android获取NetworkMode