Yii2.0-ueditor-widget 安装百度ueditor

百度UEditor

GitHub地址 https://github.com/BigKuCha/yii2-ueditor-widget

  • Either run
    composer安装:composer require kucha/ueditor "*" -vvv
  • controller:
public function actions()
{
    return [
        'upload' => [
            'class' => 'kucha\ueditor\UEditorAction',
        ]
    ];
}

或者在控制器中配置图片上传:

 public function actions(){
        return [
            'upload' => [
                'class' => 'kucha\ueditor\UEditorAction',
                'config' => [
                    "imageUrlPrefix"  => "http://www.baidu.com",//图片访问路径前缀
                    "imagePathFormat" => "/article/image/{yyyy}{mm}{dd}/{time}{rand:6}", //上传保存路径
                    "imageRoot" => \yii::getAlias("@webroot")]//待研究
        ]];
  • view:
echo $form->field($model,'colum')->widget('kucha\ueditor\UEditor',[]);

或者

field($model,'content')->widget(\kucha\ueditor\UEditor::className(),
   ['clientOptions'=>[
           'initialFrameHeight'=>'200',//高度设置
           'lang'=>'zh-cn'    //语言
       ]]);?>

你可能感兴趣的:(Yii2.0-ueditor-widget 安装百度ueditor)