yii2cmf/yii2-codemirror-asset

CodeMirror is a versatile text editor implemented in JavaScript for the browser. It is specialized for editing code, and comes with a number of language modes and addons that implement more advanced editing functionality.

Installs: 9

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Language:JavaScript

Type:yii2-extension

v1.0 2020-02-06 10:58 UTC

This package is auto-updated.

Last update: 2024-06-06 22:08:41 UTC


README

CodeMirror is a versatile text editor implemented in JavaScript for the browser. It is specialized for editing code, and comes with a number of language modes and addons that implement more advanced editing functionality.

Installation

The preferred way to install this extension is through composer.

Either run

composer require yii2cmf/yii2-codemirror-asset "1.0"
"yii2cmf/yii2-codemirror-asset": "1.0"

to the require section of your composer.json file.

Usage

Register asset bundle in view:

\yii2cmf\codemirror\CodeMirrorAsset::register($this); 

Set a different theme and mode if necessary:

$this->params['codemirror_theme'] = 'darcula';
$this->params['codemirror_mode'] = 'clike';
\yii2cmf\codemirror\CodeMirrorAsset::register($this);