php在頁(yè)面中調(diào)用fckeditor編輯器的方法
更新時(shí)間:2011年06月10日 00:19:47 作者:
fckeditor編輯器的代碼可以寫(xiě)成一個(gè)函數(shù)或者類(lèi)別,直接調(diào)用,不用每次都要寫(xiě)那么多代碼!
剛才在論壇上看到一個(gè)童鞋分享的方法,感覺(jué)不是很全面,現(xiàn)在分享下我的!
PHP頁(yè)面:
/* 編輯器 */
include_once "../include/fckeditor/fckeditor.php";//把編輯器引進(jìn)來(lái)
$editor = new FCKeditor('content');//表單項(xiàng)的名稱(chēng)
$editor->BasePath = "/fckeditor/";//編輯器所在目錄
$editor->ToolbarSet = "Normal";//工具欄的名字,可以根據(jù)自己的需求加載其他的
$editor->Width = "95%";//寬度度
$editor->Height = "250";//高度
$editor->Value = $content;//初始值
$fckeditor = $editor->CreateHtml();//在要顯示編緝器的地方輸出變量$fckeditor的值就行了
$tpl->assign('fckeditor', $fckeditor);//模板賦值
HTML模板頁(yè)面(我用的是smarty)
{%$fckeditor%}
一般php頁(yè)面調(diào)用
content 是我定義的變量名
$content =$_POST["content"];
添加:
<INPUT name="content" id="content" type=hidden>
<IFRAME id="content" src="fckeditor/editor/fckeditor.html?InstanceName=content&Toolbar=Normal" frameBorder=0 width=100% scrolling=no height=300 ></IFRAME>
修改頁(yè)面:
<INPUT name="content" id="content" type=hidden value="<?php echo $rows['content'];?>">
<IFRAME id="content" src="/fckeditor/editor/fckeditor.html?InstanceName=content&Toolbar=Normal" frameBorder=0 width=100% scrolling=no height=300 >
</IFRAME>
復(fù)制代碼 代碼如下:
PHP頁(yè)面:
/* 編輯器 */
include_once "../include/fckeditor/fckeditor.php";//把編輯器引進(jìn)來(lái)
$editor = new FCKeditor('content');//表單項(xiàng)的名稱(chēng)
$editor->BasePath = "/fckeditor/";//編輯器所在目錄
$editor->ToolbarSet = "Normal";//工具欄的名字,可以根據(jù)自己的需求加載其他的
$editor->Width = "95%";//寬度度
$editor->Height = "250";//高度
$editor->Value = $content;//初始值
$fckeditor = $editor->CreateHtml();//在要顯示編緝器的地方輸出變量$fckeditor的值就行了
$tpl->assign('fckeditor', $fckeditor);//模板賦值
HTML模板頁(yè)面(我用的是smarty)
{%$fckeditor%}
一般php頁(yè)面調(diào)用
content 是我定義的變量名
$content =$_POST["content"];
添加:
<INPUT name="content" id="content" type=hidden>
<IFRAME id="content" src="fckeditor/editor/fckeditor.html?InstanceName=content&Toolbar=Normal" frameBorder=0 width=100% scrolling=no height=300 ></IFRAME>
修改頁(yè)面:
<INPUT name="content" id="content" type=hidden value="<?php echo $rows['content'];?>">
<IFRAME id="content" src="/fckeditor/editor/fckeditor.html?InstanceName=content&Toolbar=Normal" frameBorder=0 width=100% scrolling=no height=300 >
</IFRAME>
您可能感興趣的文章:
- FCKEditor超級(jí)鏈接默認(rèn)新窗口打開(kāi)的修改方法
- Smarty中調(diào)用FCKeditor的方法
- fckeditor編輯器下的自定義分頁(yè)符實(shí)現(xiàn)方法
- FCKeditor編輯器添加圖片上傳功能及圖片路徑問(wèn)題解決方法
- ThinkPHP中FCKeditor編輯器的使用方法
- fckeditor編輯器在php中的配置方法
- Fckeditor編輯器內(nèi)容長(zhǎng)度限制統(tǒng)計(jì)實(shí)現(xiàn)方法
- FCKeditor 圖片上傳進(jìn)度條不動(dòng)的解決方法
- 瀏覽器執(zhí)行history.go(-1) FCKeditor編輯框內(nèi)顯示html源代碼的解決方法
- FCK編輯器(FCKEditor)添加新按鈕和功能的修改方法
- fckeditor粘貼Word時(shí)彈出窗口取消的方法
相關(guān)文章
PHP簡(jiǎn)單驗(yàn)證碼功能機(jī)制實(shí)例詳解
這篇文章主要介紹了PHP簡(jiǎn)單驗(yàn)證碼功能機(jī)制,結(jié)合實(shí)例形式深入淺出的分析了php驗(yàn)證碼的原理、實(shí)現(xiàn)步驟及相關(guān)操作技巧,需要的朋友可以參考下2019-03-03Ajax+PHP快速上手及簡(jiǎn)單應(yīng)用說(shuō)明
對(duì)于Ajax,最核心的一個(gè)對(duì)象是XMLHttpRequest,所有的Ajax操作都離不開(kāi)對(duì)這個(gè)對(duì)象的操作2013-07-07PHP擴(kuò)展編寫(xiě)點(diǎn)滴 技巧收集
PHP擴(kuò)展好的資源不多,轉(zhuǎn)的這個(gè)朋友應(yīng)該是個(gè)高手。他在實(shí)踐中摸索出來(lái)的這些經(jīng)驗(yàn)和大家分享。2010-03-03淺析PHP類(lèi)的反射來(lái)實(shí)現(xiàn)依賴(lài)注入過(guò)程
這篇文章主要介紹了PHP類(lèi)的反射來(lái)實(shí)現(xiàn)依賴(lài)注入過(guò)程以及相關(guān)知識(shí)點(diǎn)分享,對(duì)此有興趣的朋友跟著小編學(xué)習(xí)下吧。2018-02-02PHP編程中的Session阻塞問(wèn)題與解決方法分析
這篇文章主要介紹了PHP編程中的Session阻塞問(wèn)題與解決方法,簡(jiǎn)單分析了php session阻塞的原理、原因與簡(jiǎn)單解決方法,需要的朋友可以參考下2017-08-08PHP基于Closure類(lèi)創(chuàng)建匿名函數(shù)的方法詳解
這篇文章主要介紹了PHP基于Closure類(lèi)創(chuàng)建匿名函數(shù)的方法,結(jié)合實(shí)例形式詳細(xì)分析了Closure 類(lèi)的功能、常用函數(shù)使用技巧及相關(guān)注意事項(xiàng),需要的朋友可以參考下2017-08-08