yii2.0集成ueditor

http://www.yiichina.com/extension/342

主要是按照上面的链接来的

在composer.json中加入"kucha/ueditor": "*",
然后右键点击项目


然后找到kucha/ueditor,就可以下载了
在ActiveForm中写
 <?= $form->field($model, 'Content')->widget(\kucha\ueditor\UEditor::className(), ['id' => 'content', 'name' => 'content', 'clientOptions' => [
//编辑区域大小
        'initialFrameHeight' => '200',]]) ?>

controller
 public function actions()
    {
        return [
            'upload' => [
                'class' => 'kucha\ueditor\UEditorAction',
                /*'config' => [
                        "imageUrlPrefix"  => "http://localhost:8080",//图片访问路径前缀
                    "imagePathFormat" => "/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}" //上传保存路径
                ],*/
            ]
        ];
    }




猜你喜欢

转载自201609032307.iteye.com/blog/2347748