yuncms / yii2-summernote-widget
The Summernote extension for the Yii framework
Installs: 9 953
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:JavaScript
Type:yii2-extension
Requires
- php: >=5.4.0
- yiisoft/yii2: ~2.0.6
- yuncms/yii2-attachment: ~2.0.0
This package is auto-updated.
Last update: 2022-07-09 17:25:38 UTC
README
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist yuncms/yii2-summernote-widget "*"
or add
"yuncms/yii2-summernote-widget": "*"
to the require section of your composer.json
file.
Usage
<?php namespace app\controllers; use Yii; use yii\web\Controller; use yii\filters\AccessControl; class MyController extends Controller { /** @inheritdoc */ public function behaviors() { return [ 'access' => [ 'class' => AccessControl::className(), 'rules' => [ [ 'allow' => true, 'actions' => [ 'upload' ], 'roles' => ['@'], ], ], ], ]; } public function actions() { return [ 'upload' => [ 'class' => 'yuncms\summernote\SummerNoteAction', //etc... ], ]; } }
Once the extension is installed, simply use it in your code by :
<?= $form->field($model, 'content')->widget(\yuncms\summernote\SummerNote::className(),[ //etc... ]) ?> <?= \yuncms\summernote\SummerNote::widget(); ?>