506629361 发表于 2017-3-23 11:08:46

php中快速使用fckeditor

  fckeditor是老牌的东西,之前用ewebeditor的,最近一个项目里是fckeditor,则其实可以这样用.
  1 当然要先准备好fckeditor目录了.
  2 在editor中,可以如下代码:
   //调用编辑器主体
include('editor/fckeditor.php') ;
//设置内容区域
$oFCKeditor = new FCKeditor('content');
$oFCKeditor->Value = $article['content'];

$contentarea = $oFCKeditor->CreateHtml();
  其中$article['content']就是文章内容的变量.
  然后在要用到编辑器的页面,
include('editor.php');
  smarty模版里面
   $smarty->assign("contentarea",$contentarea);
  模版文件里
   <td>{contentarea}></td>就可以了
  内容框里提交的内容就是contentarea
页: [1]
查看完整版本: php中快速使用fckeditor