文章摘要
这篇文章介绍了如何在PHP中使用FCKEditor文本编辑器。内容包括初始化FCKEditor对象,设置其属性(如BasePath、Value和Path),并使用Create方法生成编辑器片段。此外,文章还提到通过include语句加载了FCKEditor的配置文件,并演示了如何将编辑器片段抛给模板。文章重点在于展示FCKEditor的基本用法和配置方法。
$fck=$_POST [ ” FCKeditor1 ” ] ;
if ( $fck !=”” )
{
echo htmlspecialchars ( $fck ) ;
}
?>
include ( ” fckeditor/fckeditor.php ” ) ; //加载文件
$oFCKeditor=new FCKeditor ( ‘ FCKeditor1 ‘ ) ; //创建一个FCKeditor对象 ID为FCKeditor1
$oFCKeditor -> BasePath=” /fck/fckeditor/ ” ; //设置FCKeditor路径
$oFCKeditor -> Value=” ; //设置默认值
$oFCKeditor -> Create () ; //创建。注意:若用到模板(如smarty)则$fck=$oFCKeditor->CreateHtml();然后把$fck抛给模板
?>
© 版权声明
文章版权归作者所有,未经允许请勿转载。