yii2之使用ueditor

代码效果:

1、去github下载yii2高级版ueditor扩展

2、将下载的扩展放入  /common/widgets 中(目录如图所示)

3、在视图中的代码

<?=commonwidgetsueditorUeditor::widget(['id'=>'content','name'=>'content','value' =>$model['content'],'options'=>['initialFrameWidth' => 850]])?>

代码解释:id与name都是原html标签的属性,value也是原html标签的属性,非修改操作时请去掉value这一键值对

let the world have no hard-to-write code ^-^
原文地址:https://www.cnblogs.com/ovim/p/10940652.html