PHP code example of xindong888 / yii2ueditor
1. Go to this page and download the library: Download xindong888/yii2ueditor library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
xindong888 / yii2ueditor example snippets
class PostsController extends Controller
{
public function actions()
{
return [
'yii2editor'=>[
'class'=>UEditorActionX::className(),
'config'=>[
'imagePathFormat'=>'/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}',
//'imageManagerUrlPrefix'=>'http://localhost',//前缀,主要是为了前台访问的
'imageManagerListPath'=>Yii::getAlias('@web').'/upload/image/'//这个是必填的,显示图片列表
]
]
];
}
}
$form = ActiveForm::begin();