php在页面中调用fckeditor编辑器的方法
作者:bea
刚才在论坛上看到一个童鞋分享的方法,感觉不是很全面,现在分享下我的! 代码如下: PHP页面: /* 编辑器 */ include_once "../include/fckeditor/fckeditor.php";//把编辑器引进来 $editor = new FCKeditor('content');//表单项的名称 $editor->BasePath = "/fckeditor/";//编辑器所在目录 $editor->ToolbarSet
刚才在论坛上看到一个童鞋分享的方法,感觉不是很全面,现在分享下我的!
代码如下:
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>
有用 | 无用
代码如下:
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>
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- php的memcached客户端memcached
- PHP模块 Memcached功能多于Memcache
- php模块memcache和memcached区别分析
- sphinx增量索引的一个问题
- 批量获取memcache值并按key的顺序返回的实现代码
- 提高define性能的php扩展hidef的安装和使用
- php学习笔记 php中面向对象三大特性之一[封装性]的应用
- php学习笔记 面向对象的构造与析构方法
- php学习笔记 类的声明与对象实例化
- php学习笔记 PHP面向对象的程序设计
- php学习笔记 数组的常用函数
- PHP中的函数嵌套层数限制分析
- PHP5中新增stdClass 内部保留类
- php中使用Akismet防止垃圾评论的代码
- php中通过虚代理实现延迟加载的实现代码
- php获取后台Job管理的实现代码
- php下通过curl抓取yahoo boss 搜索结果的实现代码
- PHP缩略图等比例无损压缩,可填充空白区域补充色
- PHP网站备份程序代码分享