欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

thinkPHP下ueditor的使用方法詳解

 更新時(shí)間:2015年12月26日 10:59:03   作者:釋然me  
這篇文章主要介紹了thinkPHP下ueditor的使用方法,結(jié)合實(shí)例形式較為詳細(xì)的講述了thinkPHP下使用ueditor的具體步驟與相關(guān)技巧,需要的朋友可以參考下

本文實(shí)例講述了thinkPHP下ueditor的使用方法。分享給大家供大家參考,具體如下:

1、首先需要下載ueditor,下載地址:http://ueditor.baidu.com/website/download.html

2、下載對應(yīng)的php版的,下載后重命名為ueditor,根據(jù)需要放到對應(yīng)的項(xiàng)目目錄中。我放的位置為Public/admin文件夾下,admin為后臺(tái)的訪問入口文件目錄。

3、在項(xiàng)目中的使用

首先需要引入核心的js文件:

<script type="text/javascript" charset="utf-8" src="__PUBLIC__/admin/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/admin/ueditor/ueditor.all.js"></script>

然后再文件中加入<textarea>標(biāo)簽,注意設(shè)置id屬性

復(fù)制代碼 代碼如下:
<textarea name="content" id="EditorId"> </textarea>

接著是初始化編輯器,注意配置路徑

<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "__PUBLIC__/admin/ueditor/";
window.onload=function(){
window.UEDITOR_CONFIG.initialFrameHeight=300;//編輯器的高度
   window.UEDITOR_CONFIG.initialFrameWidth=800;//編輯器的寬度
   var editor = new UE.ui.Editor({
imageUrl : '__APP__/Editor/uploadImage',
fileUrl : '__APP__/Editor/uploadFile',
imagePath : '',
filePath : '',
imageManagerUrl:'__APP__/Editor/imageManage', //圖片在線管理的處理地址
imageManagerPath:'__ROOT__/'
});
editor.render("EditorId");
}
</script>

注意:

1、UEDITOR_HOME_URL的路徑配置為ueditor所在的位置。
2、圖片上傳路徑的配置
3、editor.render("textarea的id一致");

至此一個(gè)便算基本完成。

但是,在IE9下,編輯器沒有一點(diǎn)效果,這是怎么回事呢?

在IE9下,需要把

復(fù)制代碼 代碼如下:
window.UEDITOR_HOME_URL = "__PUBLIC__/ueditor/";

路徑設(shè)置代碼,放在引入js文件和初始化之間。

希望本文所述對大家基于thinkPHP框架的php程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評論