lamp+cakephp下配置fckeditor详解 --by heng
来源:互联网 发布:大数据平台架构 编辑:程序博客网 时间:2024/05/21 18:48
1.登录http://ckeditor.com/download/ 下载FCKeditor2.6.6(在页面最下方)
2.解压FCKeditor_2.6.6.zip得到fckeditor文件夹
3.拷贝fckeditor文件夹到 app/webroot/js/ 下
4.拷贝fckeditor.php, fckeditor_php4.php, fckeditor_php5.php到 app/vendors/ 目录下
5.创建 app/views/helpers/fck.php 文件
6.在需要用到fckeditor的controller里面加入
var $helpers = array('Html', 'Form', 'Fck');
7.在views 中加入
8.进入app/webroot/js/fckeditor/editor/filemanager/connectors/php
打开 config.php
2.解压FCKeditor_2.6.6.zip得到fckeditor文件夹
3.拷贝fckeditor文件夹到 app/webroot/js/ 下
4.拷贝fckeditor.php, fckeditor_php4.php, fckeditor_php5.php到 app/vendors/ 目录下
5.创建 app/views/helpers/fck.php 文件
键入以下代码:
<?phpApp::import('Vendor', 'fckeditor');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 FCKeditor($editor_name) ; $oFCKeditor->BasePath = $basepath . '/js/fckeditor/' ; $oFCKeditor->Value = $content ; $oFCKeditor->Width = "100%"; $oFCKeditor->Height = "400"; $oFCKeditor->Create() ; } } ?>
6.在需要用到fckeditor的controller里面加入
var $helpers = array('Html', 'Form', 'Fck');
7.在views 中加入
echo $fck->fckeditor(array('Model', 'field'), $html->base, $yourContentVariable); (其中Model和field需要自己决定,$yourContentVariable可选)(在add.ctp中第三个参数要设为null,才能避免warning)
8.进入app/webroot/js/fckeditor/editor/filemanager/connectors/php
打开 config.php
1)改代码行 $Config['Enable'] = flase; 为 $Config['Enable'] = true;
- lamp+cakephp下配置fckeditor详解 --by heng
- Ubuntu 下配置 lamp+cakephp 详解 --by heng
- Asp.net下 FCKEditor 配置详解
- FCKeditor配置详解
- fckeditor配置详解
- fckeditor配置详解
- FCKeditor配置方法详解
- ubuntu-server配置LAMP+cakephp+smarty[8-2日更新]
- Jdeveloper 下配置fckeditor
- LAMP配置详解
- 在centos7系统下配置LAMP详解教程
- 在centos6.5系统下配置LAMP详解教程
- ubuntu下配置LAMP
- Ubuntu下配置LAMP
- ubuntu下配置lamp
- Linux下配置Lamp
- Linux下配置Lamp
- linux下配置lamp
- bash shell脚本处理传参,getopts的使用
- SQL Server 2008 MERGE语法
- android之调用webservice 实现图片上传
- android onLowMemory
- Vs2008使用评估期过了激活的解决办法
- lamp+cakephp下配置fckeditor详解 --by heng
- linux 修改文件的组群
- Java安装配置
- Android应用平均价格是iOS应用的2.5倍
- ruby入门_retry
- 网状结构
- 关于多线程同步问题
- 网络家园
- js小东西