kochiro / yii2-codemirror
CodeMirror extension for Yii2
Installs: 142
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-12-21 17:07:00 UTC
README
CodeMirror extension for Yii2
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist kochiro/yii2-codemirror "*"
or add
"kochiro/yii2-codemirror": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by :
field($file, 'description')->widget(CodeMirror::className(), [ 'id' => $file->id, 'name' => '[description][]'.$id, 'value' => $file->description, 'mode' => $mode, 'htmlOptions' => [ "id"=>'description_'.$file->id, "theme"=>'solarized dark' // set the theme based on the options in assets/theme, you must also include the corresponding css file in CodeMirrorAsset.php ] ]); ?>