mahonglin123456 发表于 2017-4-8 14:00:45

FCKeditor编辑器的最简单应用_by_PHP

FK是一款优秀的开源的线编辑器,而且支持多国语言。
介绍: 几种所见所得的在线编辑器的分析
官方的事例,但由于功能太多,运行的速度比较慢,而且这些功能对于一般使用都不是必须的。
所以我这里作一个结合smarty的最简单的演试,去掉了很多没用的文件,速度很快。
参考于:http://www.phpchina.com/bbs/thread-54889-1-1.html

require('./smarty/libs/Smarty.class.php');
require('./FCK/fckeditor.php');
/********************实例化FCK***********************/
function editor($filedName,$value="请填写内容吧!"){
global $smarty;
$fck=new FCKeditor($filedName);
$fck->BasePath="./FCK/";
$fck->ToolbarSet="Default";
$fck->Height="200";
$fck->Width="100%";
$fck->Value=$value;
$fckeditor=$fck->CreateHtml();
$smarty->assign("editor",$fckeditor);
}

//调用,newsContent是from的filedName
editor("newsContent");
//取值
$content = htmlspecialchars($_POST["newsContent"]);


下载fck.rar就可以直接使用
使用效果:

输出效果:
页: [1]
查看完整版本: FCKeditor编辑器的最简单应用_by_PHP