本篇文章給大家分享的是有關FCKeditor如何在Smarty中進行調用,小編覺得挺實用的,因此分享給大家學習,希望大家閱讀完這篇文章后可以有所收獲,話不多說,跟著小編一起來看看吧。
在網站建設、成都網站建設中從網站色彩、結構布局、欄目設置、關鍵詞群組等細微處著手,突出企業的產品/服務/品牌,幫助企業鎖定精準用戶,提高在線咨詢和轉化,使成都網站營銷成為有效果、有回報的無錫營銷推廣。創新互聯公司專業成都網站建設十年了,客戶滿意度97.8%,歡迎成都創新互聯客戶聯系。FCKeditor是目前互聯網上好的在線編輯器。
smarty是一個使用PHP寫出來的模板PHP模板引擎,它提供了邏輯與外在內容的分離,簡單的講,目的就是要使用PHP程序員同美工分離,使用的程序 員改變程序的邏輯內容不會影響到美工的頁面設計,美工重新修改頁面不會影響到程序的程序邏輯,這在多人合作的項目中顯的尤為重要。
在Smarty中調用FCKeditor的文件:
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傳不了值,只是生成了一個空值的編輯器,所以只能換一種方法:
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:
<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>
以上就是FCKeditor如何在Smarty中進行調用,小編相信有部分知識點可能是我們日常工作會見到或用到的。希望你能通過這篇文章學到更多知識。更多詳情敬請關注創新互聯行業資訊頻道。
文章標題:FCKeditor如何在Smarty中進行調用-創新互聯
文章URL:http://vcdvsql.cn/article44/ieohe.html
成都網站建設公司_創新互聯,為您提供網站策劃、網站改版、電子商務、網站制作、網站維護、外貿網站建設
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯