Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 1.03 KB

README.md

File metadata and controls

59 lines (40 loc) · 1.03 KB

ACE Editor Extension for Yii 2

This extension provides the ACE integration for the Yii2 framework.

Installation

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.

General Usage

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);
...