PHP code example of kriss / yii2-wang-editor

1. Go to this page and download the library: Download kriss/yii2-wang-editor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kriss / yii2-wang-editor example snippets



use kriss\wangEditor\widgets\WangEditorWidget;

echo WangEditorWidget::widget([
    'name' => 'inputName',
    //'canFullScreen' => true, // 增加全屏的按钮
    //'customConfig' => [], // 扩展配置
]);
// or
echo $form->field($model, 'content')->widget(WangEditorWidget::class, [
    //'canFullScreen' => true,
]);



namespace admin\controllers;

use yii\web\Controller;
use kriss\wangEditor\actions\UploadAction;

class FileController extends Controller
{
    public function actions()
    {
        return [
            'wang-editor' => [
                'class' => UploadAction::class,
                'savePath' => '@webroot/uploads',
                'displayPath' => '@web/uploads',
            ],
        ];
    }
}