您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP配置FCKEditor

2025/6/6 13:28:57发布21次查看
php果然简单好学,就连配置fckeditor都如此轻松,本来是打算花一到两个小时配置完成它就不错了,没想到从下载最新版本到配置成功也就不到半小时.想起当年在java下配置fckeditor时那个艰辛......
    下面记录下配置方法,把下载下来的zip文件解压到php网站的根目录下,默认文件夹名是fckeditor
    在需要加入编辑器的页面里面引用fckeditor/fckeditor.php,即
php  include ( fckeditor/fckeditor.php ); ?>
在需要加入编辑器的地方加入如下代码:  $ofckeditor   =   new  fckeditor( ' fckeditor1 ' ) ; // 建立对象
$ofckeditor -> basepath  =   ' fckeditor/ '  ; // fckeditor所在的位置
$ofckeditor -> toolbarset  =   ' default '  ; // 工具按钮
$ofckeditor -> width  =   ' 50% ' ; // 宽
$ofckeditor -> height  = ' 500 ' ; // 高
$ofckeditor -> value  = ' hello ' ; // 默认显示的文字
$ofckeditor -> create() ;
其中fckeditor1对应textarea中的name属性
    看看吧,不出意外的话配置成功。
    如果你感觉fckeditor提供的功能太多,有许多功能用不到的话,可以自己建立自定义的toolbarset具体方法就是打开fckediotr目录下的fckconfig.js,加入如下代码:
// 在名为default的toolbarset里面包含了所有fck的功能,英语好的自己看看吧
fckconfig.toolbarsets[ 自定义toolbarset名称 ] = [ [需要显示的功能]]
就这么多吧,应该没什么问题了
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product