borales / yii2-ace-widget
Yii2 Ace (Ajax.org Cloud9 Editor) Widget
Installs: 172
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 1
Open Issues: 5
Type:yii2-extension
Requires
- bower-asset/ace-builds: ~1.1
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-11-18 22:57:46 UTC
README
Ace (Ajax.org Cloud9 Editor) source repository can be found here - https://github.com/ajaxorg/ace.
Original demo can be found here - http://ace.c9.io/#nav=embedding.
Installation
The preferred way to install this extension is through composer.
Either run
$ php composer.phar require "borales/yii2-ace-widget" "*"
or add
"borales/yii2-ace-widget": "*"
to the require
section of your composer.json
file.
Usage (with default options)
// For your model echo \borales\widgets\ace\Widget::widget([ 'model' => $model, 'attribute' => 'attribute_name', ]); // Using with ActiveForm/ActiveField echo $this->field($model, 'attribute_name')->widget( \borales\widgets\ace\Widget::className() ); // For basic usage echo \borales\widgets\ace\Widget::widget([ 'name' => 'editor_name', 'value' => 'your text code', ]);
Options
mode
- code language (default isphp
).theme
- color scheme (default isgithub
).editable
- whether to display editable text input or just highlight the output (default istrue
).autocompletion
- whether to enable simple autocompletion functionality (only witheditable = true
).aceOptions
- ACE's editor options.