KindEditor在ThinkPHP模板中的使用
KindEditor编辑器
下载后,将解压目录放置在/Public/editor/下
引入css和js文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
《script》
《script》
创建编辑器
var editor;
KindEditor.ready(function(K) {
// 定义工具栏
var _items = ['source','|','undo','redo','|','justifyleft','justifycenter','justifyright','|','fontname','fontsize','forecolor','hilitecolor','bold','italic','underline','link','unlink'];
var _config = {width:'500px',heigth:'300px',resizeType:1,items:_items};
editor = K.create('#content',_config);
});
《script》
注:如果在处理页面获取不到相关值 ,则需要在表单的onsubmit中加入editor.sync(); // 将编辑
器的HTML数据同步到textarea
|
/phpkj/10169.htmlwww.phpzy.comtrue/phpkj/10169.htmlTechArticleKindEditor在ThinkPHP模板中的使用 KindEditor编辑器 下载后,将解压目录放置在/Public/editor/下 引入css和js文件 123456789101112131415161718 《script》 《script》创建编辑器 var editor;KindEditor.ready(functio...
PHP之友评论