本文主要包含ckeditor ckfinder,ckeditor php,php ckeditor上传图片,ckfinder php,ckeditor等相关知识, 希望在学习及工作中可以帮助到您
1、/ckeditor/config.js, 配置文件,如果不想写太多,可以直接写好默认配置(语言,菜单栏,宽度),有需要可以百度config配置
config.language = 'en';config.skin = 'v2';config.uiColor = '#AADC6E';config.toolbar = 'Basic';…。
2、官方的demo大多都喜欢用js配置editor区域,习惯写php的我就嫌麻烦,只好看内置的php类。
require_once ROOTPATH 。 "ckeditor/ckeditor.php";$CKEditor = new CKEditor();$CKEditor-》returnOutput = true; //设置输出可用变量的情况$CKEditor-》basePath = '/ckeditor/';//设置路径$contentarea = $CKEditor-》editor("content", $rs['contents']); //生成一个以name为content的textarea
echo $contentarea;
3、需要上传了 ,只好加入ckfinder.把ckfinder和ckeditor放在同级目录下。
打开/ckfinder/config.php, 首先设置第一个函数CheckAuthentication(),这个函数需要按照自己的规则写,只要return true的情况才能允许上传文件到服务器的,当然不建议直接写return true,这将导致安全问题。可以采用session来处理比较方便。
session_start();function CheckAuthentication(){ if(isset($_SESSION['UseEidtor']))
return true;else return false;}
4、上传文件位置:也在/ckfinder/config.php, 找到$baseUrl,之前一直想自己写一个方法用来定位路径,实在不好办,后来只好用sesssion,如果一个网站中,有需要上传到不同的位置,正好可以利用session定位。
$contentarea = $CKEditor-》editor("content", $rs['contents']);两者配合用起来还是挺不错的,更重要的原因是安全性高了很多。 </div>
config.language = 'en';config.skin = 'v2';config.uiColor = '#AADC6E';config.toolbar = 'Basic';…。
2、官方的demo大多都喜欢用js配置editor区域,习惯写php的我就嫌麻烦,只好看内置的php类。
require_once ROOTPATH 。 "ckeditor/ckeditor.php";$CKEditor = new CKEditor();$CKEditor-》returnOutput = true; //设置输出可用变量的情况$CKEditor-》basePath = '/ckeditor/';//设置路径$contentarea = $CKEditor-》editor("content", $rs['contents']); //生成一个以name为content的textarea
echo $contentarea;
3、需要上传了 ,只好加入ckfinder.把ckfinder和ckeditor放在同级目录下。
打开/ckfinder/config.php, 首先设置第一个函数CheckAuthentication(),这个函数需要按照自己的规则写,只要return true的情况才能允许上传文件到服务器的,当然不建议直接写return true,这将导致安全问题。可以采用session来处理比较方便。
session_start();function CheckAuthentication(){ if(isset($_SESSION['UseEidtor']))
return true;else return false;}
4、上传文件位置:也在/ckfinder/config.php, 找到$baseUrl,之前一直想自己写一个方法用来定位路径,实在不好办,后来只好用sesssion,如果一个网站中,有需要上传到不同的位置,正好可以利用session定位。
$contentarea = $CKEditor-》editor("content", $rs['contents']);两者配合用起来还是挺不错的,更重要的原因是安全性高了很多。 </div>