日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

在php中使用kind,KindEditor 4.x在PHP中的应用实例!

發布時間:2023/12/4 php 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 在php中使用kind,KindEditor 4.x在PHP中的应用实例! 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.解壓放入php項目靜態資源文件夾,如下圖:

Paste_Image.png

2.如果只是php使用,可以刪除其它類型語言的文件夾,文件結構如下圖:

Paste_Image.png

3.打開php文件夾,更改upload_json.php里文件上傳目錄文件夾至Uploads,修改上傳文件大小限制。如下圖:

Paste_Image.png

4.然后效果圖如下:

Paste_Image.png

firebug審查提交數據,經測試可以正常獲取使用KindEditor4.x獲取圖片實時上傳和textarea內容!

Paste_Image.png

代碼如下:

封面圖:

//圖片數據

內容://文本域內容

//引入jquery文件

KindEditor.ready(function(K) {

//textarea

editor = K.create('#contents', {

//themeType: 'simple',

resizeType : 1,

allowImageRemote : true,

width : '60%',

height : '40%',

uploadJson: '__PUBLIC__/kindeditor/php/upload_json.php',

fileManagerJson: '__PUBLIC__/kindeditor/php/file_manager_json.php',

//items : ['source','bold','italic','underline','forecolor','image'],

afterCreate: function(){this.sync();}, //此行可不寫,不影響獲取textarea的值

afterBlur : function(){this.sync();}//需要添加的

});

//封面圖實時上傳

K('#image').click(function() {

editor.loadPlugin('image', function() {

editor.plugin.imageDialog({

imageUrl : K('#url').val(),

clickFn : function(url, title, width, height, border, align) {

K('#url').val(url);

K("#image_show").html('![]('+url+')');

editor.hideDialog();

}

});

});

});

});

總結

以上是生活随笔為你收集整理的在php中使用kind,KindEditor 4.x在PHP中的应用实例!的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。