toir427 / yii2-aceeditor
Yii2 ajax.org Ace Editor widget
Package info
github.com/toir427/yii2-aceeditor
Type:yii2-extension
pkg:composer/toir427/yii2-aceeditor
dev-master
2019-12-30 17:12 UTC
Requires
- bower-asset/ace-builds: ^1.2.3
- yiisoft/yii2: ^2.0.0
This package is auto-updated.
Last update: 2026-02-26 23:50:12 UTC
README
About
It is Ace Editor integration for Yii2 framework.
Demo
Ace Editor demo can be found here
Installation
The preferred way to install this extension is through composer.
Either run
composer require toir427/yii2-aceeditor "dev-master"
or add
"toir427/yii2-aceeditor": "*"
to the require section of your composer.json file.
Usage
Using model
\toir427\aceeditor\AceEditor::widget([ // You can either use it for model attribute 'model' => $my_model, 'attribute' => 'my_field', // or just for input field 'name' => 'my_input_name', 'mode'=>'html', // programing language mode. Default "html" 'theme'=>'github', // editor theme. Default "github" 'readOnly'=>'true' // Read-only mode on/off = true/false. Default "false" ]);
With active field
$form->field($model, 'field')->widget( \toir427\aceeditor\AceEditor::className(), [ 'mode'=>'html', // programing language mode. Default "html" 'theme'=>'github', // editor theme. Default "github" 'readOnly'=>'true' // Read-only mode on/off = true/false. Default "false" ] )
Lists of all available modes and themes see here