最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Smarty中調(diào)用FCKeditor的方法

 更新時(shí)間:2014年10月27日 15:43:19   投稿:shichen2014  
這篇文章主要介紹了Smarty中調(diào)用FCKeditor的方法,對(duì)比常見的錯(cuò)誤方法講述了Smarty中調(diào)用FCKeditor的實(shí)現(xiàn)過程,是非常實(shí)用的技巧,需要的朋友可以參考下

本文實(shí)例講述了Smarty中調(diào)用FCKeditor的方法,分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:

FCKeditor是目前互聯(lián)網(wǎng)上最好的在線編輯器。

smarty是一個(gè)使用PHP寫出來的模板PHP模板引擎,它提供了邏輯與外在內(nèi)容的分離,簡(jiǎn)單的講,目的就是要使用PHP程序員同美工分離,使用的程序 員改變程序的邏輯內(nèi)容不會(huì)影響到美工的頁(yè)面設(shè)計(jì),美工重新修改頁(yè)面不會(huì)影響到程序的程序邏輯,這在多人合作的項(xiàng)目中顯的尤為重要。

在Smarty中調(diào)用FCKeditor的文件:

復(fù)制代碼 代碼如下:
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');

但是運(yùn)用這一種方法在編輯資料的時(shí)候竟然FCKeditor傳不了值,只是生成了一個(gè)空值的編輯器,所以只能換一種方法:

復(fù)制代碼 代碼如下:
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');

模板文件template.tpl:

復(fù)制代碼 代碼如下:
<htm> 
<head> 
<title>example of smarty use fckeditor</title> 
</head> 
 
<body> 
<P>Example</p> 
<p>title:<{$Title}></p> 
<p></p> 
<p>content:</p> 
<p><{$FCKeditor}></p> 
</body> 
</html>

希望本文所述對(duì)大家的PHP程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

石门县| 河南省| 邵武市| 张北县| 定陶县| 滕州市| 本溪市| 都匀市| 招远市| 金寨县| 西城区| 高青县| 保山市| 汨罗市| 阿合奇县| 边坝县| 来安县| 南投县| 临清市| 平乡县| 天镇县| 万载县| 梧州市| 仪征市| 什邡市| 横山县| 高陵县| 西平县| 淮滨县| 贵定县| 长武县| 出国| 桂林市| 姚安县| 凤阳县| 辽源市| 邯郸县| 清苑县| 霍林郭勒市| 泾阳县| 南充市|