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

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

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

  2021-03-18 我要评论
想了解php在页面中调用fckeditor编辑器的方法的相关内容吗,在本文为您仔细讲解fckeditor编辑器的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:fckeditor,编辑器,下面大家一起来学习吧。
刚才在论坛上看到一个童鞋分享的方法,感觉不是很全面,现在分享下我的!
复制代码 代码如下:

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>

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们