fckeditorphp php在页面中调用fckeditor编辑器的代码
2017-01-10 | 来源:网络 | 人气: | | 关键字: fckeditorphp php在线代码编辑器
关于FckEditor的文章,学院以前介绍了一些,今天再来说一下如何使用PHP调用FCK编辑器,fckeditor编辑器的代码可以写成一个函数或者类别,直接调用,不用每次都要写那么多代码!刚才在论坛上
关于FckEditor的文章,学院以前介绍了一些,今天再来说一下如何使用PHP调用FCK编辑器,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 heiwww.alonely.com.cnght=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>
为您推荐
- 推荐
-
php在页面中调用fckeditor编辑器的代码
2017-01-10
-
简析JavaScript按位运算符的应用
2017-01-10
-
JavaScript框架工具JavaScriptMVC 1.5
2017-01-10
-
用于查询操作的javascript类库[附源码]
2017-01-10
-
Extjs中的迭代方法
2017-01-10
-
JS判断来路搜索引擎并提示加入收藏
2017-01-09
-
兼容IE和Firefox的、读取本地文件JS代码
2017-01-09
-
Prototype系列(1)初探prototype.js
2017-01-09
-
Javascript 验证身份证是否有效
2017-01-09
-
JavaScript自定义多级联动浮动菜单[一]
2017-01-09
- 更多JavaScript教程信息
头条推荐
- 热门排行
- 评论排行
评论
评论数10