- PHP >= 5.4.0
- Composer
- Yii2
composer require eddycjy/yii2-ueditor "@dev"
Add to configs file
-
yii-basic : config/web.php
-
yii-advanced: common/config/main.php
'modules' => [
'ueditor' => [
'class' => 'Ueditor\UeditorModule',
],
],
or change ue-configs, upload folder root_path @app/web
'modules' => [
'ueditor' => [
'class' => 'Ueditor\UeditorModule',
'imageUrlPrefix' => '',
'imagePathFormat' => '/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}',
'scrawlUrlPrefix' => '',
'scrawlPathFormat' => '',
'snapscreenUrlPrefix' => '',
'snapscreenPathFormat' => '',
'catcherUrlPrefix' => '',
'catcherPathFormat' => '',
'videoUrlPrefix' => '',
'videoPathFormat' => '',
'fileUrlPrefix' => '',
'filePathFormat' => '',
'imageManagerUrlPrefix' => '',
'imageManagerListPath' => '',
'fileManagerUrlPrefix' => '',
'fileManagerListPath' => '',
],
],
Config view/form
<?= $form->field($model, 'content')->widget(\Ueditor\Widgets\Ueditor::className()) ?>
or widget
<?= \Ueditor\Widgets\Ueditor::widget([]) ?>
or config advanced ueditor reference Docs
<?= \Ueditor\Widgets\Ueditor::widget([
'id' => 'content',
'options' => [
'initialFrameWidth' => 666,
],
]) ?>
MIT