eddycjy / yii2-ueditor
Yii2 widget for ueditor
1.0.0
2017-11-05 08:30 UTC
Requires
- php: >=5.4
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-03-09 11:07:03 UTC
README
Requirements
- PHP >= 5.4.0
- Composer
- Yii2
Installation
composer require eddycjy/yii2-ueditor "@dev"
Configuration
Use File
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' => '', ], ],
Usage
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, ], ]) ?>
License
MIT