2017 © Pedro Peláez
 

yii2-extension yii2-widget-codemirror

Yii2 codemirror widget

image

skeeks/yii2-widget-codemirror

Yii2 codemirror widget

  • Saturday, November 7, 2015
  • by skeeks-semenov
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6,740 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 4 % Grown

The README.md

Codemirror widget for Yii2 framework

Description

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. For more information please visit CodeMirror, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

To install, either run, (*3)

$ php composer.phar require skeeks/yii2-widget-codemirror "*"

or add, (*4)

"skeeks/yii2-widget-codemirror": "*"

to the require section of your composer.json file., (*5)

Usage

use skeeks\widget\codemirror\CodemirrorWidget;

$form->field($model, 'code')->widget(
    CodemirrorWidget::className(),
    [
        'preset'=>'php',
        'options'=>['rows' => 20],
    ]
);

You can use ready-made presets, or create your own. To do this, specify the folder to your presets., (*6)

use skeeks\widget\codemirror\CodemirrorWidget;

$form->field($model, 'code')->widget(
    CodemirrorWidget::className(),
    [
        'presetDir'=>'/path_to_your_presets',
        'preset'=>'sql',
    ]
);

In general, you can customize the widget directly specifying its properties., (*7)

use skeeks\widget\codemirror\CodemirrorWidget;
use skeeks\widget\codemirror\CodemirrorAsset;

$form->field($model, 'code')->widget(
    CodemirrorWidget::className(),
    [
        'assets'=>[
            CodemirrorAsset::MODE_CLIKE,
            CodemirrorAsset::KEYMAP_EMACS,
            CodemirrorAsset::ADDON_EDIT_MATCHBRACKETS,
            CodemirrorAsset::ADDON_COMMENT,
            CodemirrorAsset::ADDON_DIALOG,
            CodemirrorAsset::ADDON_SEARCHCURSOR,
            CodemirrorAsset::ADDON_SEARCH,
        ],
        'settings'=>[
            'lineNumbers' => true,
            'mode' => 'text/x-csrc',
            'keyMap' => 'emacs'
        ],
    ]
);

License

conquer/codemirror is released under the MIT License. See the bundled LICENSE.md for details., (*8)

The Versions

07/11 2015

dev-master

9999999-dev http://git.skeeks.com/skeeks/yii2-widget-codemirror

Yii2 codemirror widget

  Sources   Download

BSD 3-Clause

The Requires

 

by Semenov Alexander

extension yii2 widget codemirror

07/11 2015

1.0.3

1.0.3.0 http://git.skeeks.com/skeeks/yii2-widget-codemirror

Yii2 codemirror widget

  Sources   Download

BSD 3-Clause

The Requires

 

by Semenov Alexander

extension yii2 widget codemirror

06/06 2015

1.0.1

1.0.1.0 http://git.skeeks.com/skeeks/yii2-widget-codemirror

Yii2 codemirror widget

  Sources   Download

BSD 3-Clause

The Requires

 

by Semenov Alexander

extension yii2 widget codemirror

06/06 2015

1.0.2

1.0.2.0 http://git.skeeks.com/skeeks/yii2-widget-codemirror

Yii2 codemirror widget

  Sources   Download

BSD 3-Clause

The Requires

 

by Semenov Alexander

extension yii2 widget codemirror

05/06 2015

1.0.0

1.0.0.0 http://git.skeeks.com/skeeks/yii2-widget-codemirror

Yii2 codemirror widget

  Sources   Download

BSD 3-Clause

The Requires

 

by Semenov Alexander

extension yii2 widget codemirror