andreosoft / yii2-codemirror-widget
The Codemirror extension for the Yii framework
Installs: 38
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- bower-asset/codemirror: *
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-05-03 00:36:12 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]) ?>