配置文件
<?
$BasePath = "../include/FCKeditor/";//定义路径,includes是三级路径
include($BasePath."fckeditor.php");
$fck = new FCKeditor('p_info') ;//建立对像
$fck->BasePath = $BasePath ;//Fckeditor所在的位置
$fck->ToolbarSet = 'News' ;//News为自定义的Fckeditor工具栏名称
$fck->Width = '700' ;//长度
$fck->Height = '350' ;//高度
$fck->Config['AutoDetectLanguage'] = false ;//语言自动检测
$fck->Config['DefaultLanguage']= 'zh-cn' ;//语言
1.此处basepath的路径一定要和上面include的路径一样.否则会找不到文件)
$content = $fck->CreateHtml();//创建Fckeditor脚本文件
$smarty->assign('content',$content);
$smarty->display("fck.tpl");
?>
在smarty的文件中需要显示的地方
<tr align="left">
<td colspan="2" valign="top" bgcolor="#F5F5F5" class="font12en">
<{$content}>
</td>
</tr>
提取Fckeditor时,采用如下
PHP用$_POST['p_info']得到FCKeditor的值
补充:
另外,对于这个输入内容的变量,如果要把它存入数据库,它的变量名为你建
立对象的名字.例如上面就是"p_info"
2.在FCKeditor/_samples/里面有个php调用的例子.如simples01.php
和sampleposteddata.php这两个.后面那个文件是输出变量名的php
程序,通过这个程序可以得到文本输入框内容的变量名.
3.配置 FCKeditor的toolbar功能按钮可以很容易地进行定制,你可以依据你
的需要在FCKeditor的配置文件FCKeditor/fck_config.js中进行定制
一个功能按钮对应一个唯一的名称。
在fck_config.js中默认情况下已经设定好三种toolbar样式:Default(包
含全部功能),Accessibility和Basic。
-------合体配置
一、在Smarty中调用FCKeditor的文件: /*实例并初始FCKeditor*/ /*实例并初始Smarty*/ 二、template.tpl 三、获取FCKeditor传递值 getValue.php |