jocoh/yii2-tinymce-widget

TinyMCE Widget for Yii2

Installs: 307

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

v1.0.2 2016-12-11 11:06 UTC

This package is not auto-updated.

Last update: 2024-04-13 17:41:11 UTC


README

TinyMCE Widget for Yii2

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require jocoh/yii2-tinymce-widget "*"

or add

"jocoh/yii2-tinymce-widget": "*"

to the require section of your composer.json file.

Usage

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

Possible TinyMCE options:

use jocoh\tinymce\TinyMce;

     echo TinyMce::widget( [
               'name' => 'content',
               'options' => ['rows' => 6], 
               'clientOptions' => [        
                   'plugins' => [
                         "advlist autolink lists link charmap print preview anchor",
                         "searchreplace visualblocks code fullscreen",
                         "insertdatetime media table contextmenu paste"
                    ],
                    'toolbar' => "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
               ],
          ]);
    ?>

ActiveForm

use jocoh\tinymce\TinyMce;

     echo $form->field($model, 'content')->widget(TinyMce::className(), [
          'options' => ['rows' => 6], 
          'clientOptions' => [ 
               'plugins' => [
                    "advlist autolink lists link charmap print preview anchor",
                    "searchreplace visualblocks code fullscreen",
                    "insertdatetime media table contextmenu paste"
               ],
               'toolbar' => "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
          ],
     ]);