下面记录下配置方法,把下载下来的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名称 ] = [ [需要显示的功能]]
就这么多吧,应该没什么问题了
