PHP code example of codezeen / yii2-tinymce

1. Go to this page and download the library: Download codezeen/yii2-tinymce 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/ */

    

codezeen / yii2-tinymce example snippets


<?= \codezeen\yii2\tinymce\TinyMceAsset::register($this); 

<?= $form->field($model, 'attribute')->widget(
    TinyMce::className(),
    [
        'settings'        => [
            'language'               => 'en',
            'plugins'                => [
                "advlist autolink lists link image charmap print preview hr anchor pagebreak",
                "searchreplace visualblocks visualchars code fullscreen",
                "insertdatetime media nonbreaking save table contextmenu directionality",
                "template paste textcolor"
            ],
            'toolbar'                => "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media | forecolor backcolor",
            'toolbar_items_size'     => 'small',
            'image_advtab'           => true,
            'relative_urls'          => false,
        ],
    ]
) 

<?= TinyMce::widget([
    // ...
]) 

public function actions()
{
    return [
        'tinyMceCompressor' => [
            'class' => TinyMceCompressorAction::className(),
        ],
    ];
}

$form->field($model, 'content')->widget(
    TinyMce::className(),
    ['compressorRoute' => 'controller/tiny-mce-compressor']
)

php composer.phar