shiyang / yii2-umeditor
UMeditor 是一个简化版的 ueditor。
v1.2
2016-02-01 10:47 UTC
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-09-28 17:54:39 UTC
README
UMeditor 是一个简化版的 ueditor。
安装
通过 composer 安装此扩展是首选方法。
运行以下命令之一
php composer.phar require --prefer-dist shiyang/yii2-umeditor "*"
或者
"shiyang/yii2-umeditor": "*"
将以下内容添加到您的 composer.json 文件的 require 部分。
使用方法
扩展安装后,您只需在代码中使用它即可
控制器
public function actions() { return [ 'upload' => [ 'class' => 'shiyang\umeditor\UMeditorAction', ] ]; }
视图
<?php $form = ActiveForm::begin(); ?> <?= $form->field($model, 'content')->widget('shiyang\umeditor\UMeditor', [ 'clientOptions' => [ 'initialFrameHeight' => 100, 'toolbar' => [ 'source | undo redo | bold |', 'link unlink | emotion image video |', 'justifyleft justifycenter justifyright justifyjustify |', 'insertorderedlist insertunorderedlist |' , 'horizontal preview fullscreen', ], ] ])->label(false) ?> <div class="form-group"> <?= Html::submitButton('Create', ['class' => 'btn btn-primary']) ?> </div> <?php ActiveForm::end(); ?>
更多信息
请查阅 Umeditor 插件网站 或 配置 文档,以获取有关其配置选项的更多信息。
演示
查看 umeditor