YII2 系统中引用在线文本编辑器

在系统中如果需要使用在线文本编辑器参考下面代码:

1.在页面中加入文本域,一定要有一个指定的Id:

{input type='textarea' id='content' model=$model field='content'}

 2.在页面底部引入js

<!-- 在线文本编辑器 -->
{script src='@static/js/editor/kindeditor-all-min.js,@static/js/editor/lang/zh_CN.js'}
<!-- 创建KindEditor的脚本 必须设置editor_id属性,editor_id为文本域的ID属性 -->
{include file=alias('@common/library/kindeditor.tpl') editor_id=$editor_id}


猜你喜欢

转载自niqingyang.iteye.com/blog/2295788
今日推荐