PHP code example of brussens / yii2-trumbowyg

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

    

brussens / yii2-trumbowyg example snippets


use brussens\yii2\extensions\trumbowyg\TrumbowygWidget;

echo $form->field($form, 'content')->widget(TrumbowygWidget::className());

use brussens\yii2\extensions\trumbowyg\TrumbowygWidget;

echo $form->field($form, 'content')->widget(TrumbowygWidget::className(), [
    'clientOptions' => [
        'btns' => [
            ['viewHTML'],
            ['undo', 'redo'],
            ['table'],
            ['formatting'],
            ['strong', 'em', 'del'],
            ['link'],
            ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],
            ['unorderedList', 'orderedList'],
            ['removeformat'],
            ['fullscreen'],
            ['upload'],
        ]
    ],
    'plugins' => [
        TrumbowygWidget::PLUGIN_UPLOAD,
        TrumbowygWidget::PLUGIN_TABLE,
        TrumbowygWidget::PLUGIN_HISTORY
    ]
]);

php composer.phar