在Smarty中调用FCKeditor的文件
代码如下//FCKeditor in smarty
//Rossy.cn@gmail.com
//2007-09-12 13:14
require_once("conn.php");
require_once("class/Smarty.class.php");
$smarty = new Smarty();
$smarty->template_dir = "../templates";
$smarty->compile_dir = "../templates_c";
$smarty->left_delimiter = "<{";
$smarty->right_delimiter = "}>";
$editor = new FCKeditor("Content") ;
$editor->BasePath = "../FCKeditor/";
$editor->ToolbarSet = "Basic";
$editor->Value = "";
$FCKeditor = $editor->CreateHtml();
$smarty->assign("Title","Rossy is here waiting for you");
$smarty->assign("FCKeditor",$FCKeditor);
$smarty->display("template.tpl");
但,运用这一种方法在编辑资料的时候竟然FCKeditor传不了值,只是生成了一个空值的编辑器,所以只能换一种方法:
代码如下//FCKeditor in smarty
//Rossy.cn@gmail.com
//2007-09-12 13:18
require_once("conn.php");
require_once("class/Smarty.class.php");
$smarty = new Smarty();
$smarty->template_dir = "../templates";
$smarty->compile_dir = "../templates_c";
$smarty->left_delimiter = "<{";
$smarty->right_delimiter = "}>";
$editor = new FCKeditor("Content") ;
$editor->BasePath = "../FCKeditor/";
$editor->ToolbarSet = "Basic";
$editor->Value = "Here is a example of smarty and FCKeditor";
$smarty->assign("Title","Rossy is here waiting for you");
$smartyl->assign_by_ref("FCKeditor",$editor);
$smarty->display("template.tpl");
调用
代码如下Example title:<{$Title}> content: <{$FCKeditor}>