xutl / yii2-summernote-widget
The summer note extension for the Yii framework
Installs: 8 999
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 4
Open Issues: 0
Language:JavaScript
Type:yii2-extension
Requires
- php: >=5.4.0
- yiisoft/yii2: ~2.0.6
README
适用于YII2的一个富文本编辑器
Installation
The preferred way to install this extension is through composer.
Either run
composer require --prefer-dist xutl/yii2-summernote-widget
or add
"xutl/yii2-summernote-widget": "~1.0.0"
to the require
section of your composer.json.
使用
<?php namespace app\controllers; use Yii; use yii\web\Controller; use xutl\summernote\SummerNoteAction; class MyController extends Controller { public function actions() { return [ 'sn-upload' => [ 'class' => SummerNoteAction::className(), 'onComplete' => function ($filename, $params) { // Do something with file //返回图像的Url地址 } ], ]; } }
widget:
use xutl\summernote\SummerNote; <?= $form->field($model, 'description')->widget(SummerNote::className(), [ 'uploadUrl'=>'/file/sn-upload' ]);?>