TinyMce Widget

What is the TinyMce Widget?

The TinyMce widget allows to you use the amazing WYSIWYG TinyMce plugin on your forms.

Installation

The preferred way to install this extension is through composer.

Either run

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

or add the following to the require section of your application's composer.json file:

"2amigos/yii2-tinymce-widget" : "*" 

Usage example

<?php
use dosamigos\tinymce\TinyMce;

?>
<?= $form->field($model, 'text')->widget(TinyMce::className(), [
    'options' => ['rows' => 6],
    'language' => 'es',
    '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"
    ]
]);?>

Share this

Contributors Thanks All

 

Do you have a good idea? Why Don't We Talk?