PHP code example of wbraganca / yii2-ace-widget

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

    

wbraganca / yii2-ace-widget example snippets



use wbraganca\AceEditor\AceEditorWidget;

// For basic usage
echo AceEditorWidget::widget([
    'name' => 'editor_name',
    'value' => 'your text code',
]);

// Ace editor with emmet
$this->registerJsFile('https://cloud9ide.github.io/emmet-core/emmet.js');
echo AceEditorWidget::widget([
    'id' => 'attribute_id',
    'model' => $model,
    'attribute' => 'attribute_name',
    'theme' => 'sqlserver',
    'extensions' => [
        'emmet'
    ],
    'aceOptions' => [
        'showPrintMargin' => false,
        'minLines' => 20,
        'maxLines' => 500,
        'newLineMode' => 'unix'
    ]
]);
bash
$ php composer.phar