wise5lin/yii2-tinymce5

This package is abandoned and no longer maintained. No replacement package was suggested.

TinyMCE 5 widget for Yii 2

Installs: 14

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Forks: 0

Type:yii2-extension

1.0.0 2019-11-12 13:06 UTC

This package is not auto-updated.

Last update: 2024-01-18 08:44:29 UTC


README

Installation

The preferred way to install this extension is through the composer.

Just run the command:

php composer.phar require --prefer-dist wise5lin/yii2-tinymce5 "~1.0.0"

or add

"wise5lin/yii2-tinymce5": "~1.0.0"

into the require section of your composer.json file.

Using

Once the extension is installed, just use it in your code:

use wise5lin\tinymce5\TinyMCE;

<?= $form->field($model, 'content')->widget(TinyMCE::class) ?>

Settings

preset - selection of predefined settings for the editor panel. It can take values basic, full and custom.

<?= $form->field($model, 'content')->widget(TinyMCE::class, [
    'preset' => 'full', // basic (default), custom
]) ?>

Basic preset

basic preset

Full preset does not include premium plugins

full preset

editorOptions - js editor options, see all possible options on the official website.

<?= $form->field($model, 'content')->widget(TinyMCE::class, [
    'preset' => 'full',
    // https://www.tiny.cloud/docs/configure
    'editorOptions' => [
         'height' => 300,
    ]
]) ?>

editorInlineContainerTag - the HTML tag for the container of the editor in inline mode.

Used only if the editor is in inline mode!

<?= $form->field($model, 'content')->widget(TinyMCE::class, [
    'preset' => 'full',
    'editorOptions' => [
         'height' => 300,
         'inline' => true,
    ],
    'editorInlineContainerTag' => 'div' // Default
]) ?>

editorInlineContainerOptions - the HTML attributes for the container of the editor in inline mode.

Used only if the editor is in inline mode!

<?= $form->field($model, 'content')->widget(TinyMCE::class, [
    'preset' => 'full',
    'editorOptions' => [
         'height' => 300,
         'inline' => true,
    ],
    'editorInlineContainerTag' => 'div',
    'editorInlineContainerOptions' => [
        'class' => 'my-class'
    ],
]) ?>