Skip to content

black-lamp/yii2-code-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code editor for Yii2

Widget for Ace code editor

Latest Stable Version Latest Unstable Version License

Installation

Run command

composer require black-lamp/yii2-text-editor

or add

"black-lamp/yii2-text-editor": "2.0.0"

to the require section of your composer.json.

Using

Use widget with ActiveForm

$form = ActiveForm::begin();
    // ...
    echo $form->field($model, 'text')
              ->widget(bl\ace\AceWidget::className(), [
                    'language' => 'javascript'
              ]);
$form->end();

Widget configuration properties

Option Option Default Description
language string html Programming language
theme string github Code editor theme
enableEmmet boolean false Enable emmet plugin for HTML
attributes array ['style' => 'max-width: 600px; min-height: 400px;'] HTML attributes for editor container

For more information about 'language' and 'theme' configuration attributes read Ace documentation