yuncms/yii2-summernote-widget

The Summernote extension for the Yii framework

Installs: 9 272

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:JavaScript

Type:yii2-extension

1.0.0 2017-09-18 10:30 UTC

This package is auto-updated.

Last update: 2022-05-10 21:58:21 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(); ?>