斯马特y中调用FCKeditor的点子

<htm>
<head>
<title>example of smarty use fckeditor</title>
</head>

require_once(“conn.php”);
require_once(“class/Smarty.class.php”);

在Smarty中调用FCKeditor的文件:

smarty是二个接纳PHP写出来的沙盘PHP模板引擎,它提供了逻辑与外在内容的告别,简单的说,指标正是要使用PHP程序猿同美术职业分离,使用的次序
员改动程序的逻辑内容不会耳熟能详到图案的页面设计,美术职业重新修改页面不会听得多了就能说的清楚到程序的程序逻辑,那在几个人搭档的体系中显的越来越重大。

梦想本文所述对我们的PHP程序设计具备援救。

模板文件template.tpl:

复制代码 代码如下:

FCKeditor是时下互连网络最棒的在线编辑器。

require_once(“conn.php”);
require_once(“class/Smarty.class.php”);

$smarty = new Smarty();
manbetx手机网页版,$smarty->template_dir = “../templates”;
$smarty->compile_dir = “../templates_c”;
$smarty->left_delimiter = “<{“;
$smarty->right_delimiter = “}>”;

正文实例陈述了斯马特y中调用FCKeditor的不二秘技,分享给我们供我们参谋。具体达成格局如下:

<body>
<P>Example</p>
<p>title:<{$Title}></p>
<p></p>
<p>content:</p>
<p><{$FCKeditor}></p>
</body>
</html>

复制代码 代码如下:

$smarty->assign(‘Title’,”Rossy is here waiting for you”);
$smarty->assign(‘FCKeditor’,$FCKeditor);
$smarty->display(‘template.tpl’);

$editor = new FCKeditor(“Content”) ;
$editor->BasePath = “../FCKeditor/”;
$editor->ToolbarSet = “Basic”;
$editor->Value = “”;
$FCKeditor = $editor->CreateHtml();

$smarty->assign(‘Title’,”Rossy is here waiting for you”);
$smartyl->assign_by_ref(“FCKeditor”,$editor);
$smarty->display(‘template.tpl’);

$editor = new FCKeditor(“Content”) ;
$editor->BasePath = “../FCKeditor/”;
$editor->ToolbarSet = “Basic”;
$editor->Value = “Here is a example of smarty and FCKeditor”;

然则使用这一种方式在编辑资料的时候竟然FCKeditor传不了值,只是生成了二个空值的编辑器,所以不得不换一种艺术:

复制代码 代码如下:

$smarty = new Smarty();
$smarty->template_dir = “../templates”;
$smarty->compile_dir = “../templates_c”;
$smarty->left_delimiter = “<{“;
$smarty->right_delimiter = “}>”;

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图