kochiro / yii2-codemirror
CodeMirror extension for Yii2
Package info
github.com/jay-leno/yii2-codemirror
Type:yii2-extension
pkg:composer/kochiro/yii2-codemirror
v1.1.1
2015-03-11 19:59 UTC
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2026-02-28 22:51:05 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 ] ]); ?>