andreosoft / yii2-codemirror-widget
The Codemirror extension for the Yii framework
Package info
github.com/andreosoft/yii2-codemirror-widget
Type:yii2-extension
pkg:composer/andreosoft/yii2-codemirror-widget
dev-master
2017-03-25 18:43 UTC
Requires
- bower-asset/codemirror: *
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2026-03-07 04:41:56 UTC
README
CodeMirror extension for Yii2
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require 'andreosoft/yii2-codemirror-widget'
or add
"andreosoft/yii2-codemirror-widget": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
field($model, 'content')->widget(Codemirror::className(), [ 'editorOptions' => [ 'lineNumbers' => true, 'matchBrackets' => true, 'indentUnit' => 4, 'indentWithTabs' => true, 'mode' => 'application/x-httpd-php', ], 'editorHeight' => 800]) ?>