当前位置:Gxlcms > PHP教程 > php在页面中调用fckeditor编辑器的方法_PHP教程

php在页面中调用fckeditor编辑器的方法_PHP教程

时间:2021-07-01 10:21:17 帮助过:25人阅读

刚才在论坛上看到一个童鞋分享的方法,感觉不是很全面,现在分享下我的!
代码如下:
  1. <br>PHP页面: <br>/* 编辑器 */ <br>include_once "../include/fckeditor/fckeditor.php";//把编辑器引进来 <br>$editor = new FCKeditor('content');//表单项的名称 <br>$editor->BasePath = "/fckeditor/";//编辑器所在目录 <br>$editor->ToolbarSet = "Normal";//工具栏的名字,可以根据自己的需求加载其他的 <br>$editor->Width = "95%";//宽度度 <br>$editor->Height = "250";//高度 <br>$editor->Value = $content;//初始值 <br>$fckeditor = $editor->CreateHtml();//在要显示编缉器的地方
输出变量$fckeditor的值就行了
$tpl->assign('fckeditor', $fckeditor);//模板赋值

HTML模板页面(我用的是smarty)
{%$fckeditor%}

一般php页面调用
content 是我定义的变量名
$content =$_POST["content"];
添加:


修改页面:


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/323546.htmlTechArticle刚才在论坛上看到一个童鞋分享的方法,感觉不是很全面,现在分享下我的! 代码如下:

  1. PHP页面: /* 编辑器 */ include_once "../inclu...<p></p>

人气教程排行