当前位置: 移动技术网 > IT编程>开发语言>PHP > php在页面中调用fckeditor编辑器的方法

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

2019年04月22日  | 移动技术网IT编程  | 我要评论

051jk,tsmm,qlb-06

刚才在论坛上看到一个童鞋分享的方法,感觉不是很全面,现在分享下我的!
复制代码 代码如下:

php页面:
/* 编辑器 */
include_once "../include/fckeditor/fckeditor.php";//把编辑器引进来
$editor = new fckeditor('content');//表单项的名称
$editor->basepath = "/fckeditor/";//编辑器所在目录
$editor->toolbarset = "normal";//工具栏的名字,可以根据自己的需求加载其他的
$editor->width = "95%";//宽度度
$editor->height = "250";//高度
$editor->value = $content;//初始值
$fckeditor = $editor->createhtml();//在要显示编缉器的地方输出变量$fckeditor的值就行了
$tpl->assign('fckeditor', $fckeditor);//模板赋值

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

一般php页面调用
content 是我定义的变量名
$content =$_post["content"];
添加:
<input name="content" id="content" type=hidden>
<iframe id="content" src="fckeditor/editor/fckeditor.html?instancename=content&toolbar=normal" frameborder=0 width=100% scrolling=no height=300 ></iframe>
修改页面:
<input name="content" id="content" type=hidden value="<?php echo $rows['content'];?>">
<iframe id="content" src="/fckeditor/editor/fckeditor.html?instancename=content&toolbar=normal" frameborder=0 width=100% scrolling=no height=300 >
</iframe>

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网