This extension provides the ACE integration for the Yii2 framework.
This extension requires ace-builds
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist devgroup/yii2-ace-widget "*"
or add
"devgroup/yii2-ace-widget": "*"
to the require section of your composer.json.
use devgroup\ace\Ace;
Ace::widget([
'mode' => 'php', // editor mode
'name' => '', // editor name
'options' => [], // html options
'theme' => 'github', // editor theme
'value' => '', // editor default value
]);
or
in view file
<?= yii\helpers\Html::textarea('', '', ['data-editor' => 'html', 'data-read-only' => false]) ?>
and your controller
use devgroup\ace\AceHelper
...
AceHelper::setAceScript(controller, theme);
...