toir427/yii2-aceeditor

Yii2 ajax.org Ace Editor widget

Installs: 94

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2019-12-30 17:12 UTC

This package is auto-updated.

Last update: 2024-05-26 20:00:56 UTC


README

About

It is Ace Editor integration for Yii2 framework.

Demo

Ace Editor demo can be found here

Installation

The preferred way to install this extension is through composer.

Either run

composer require toir427/yii2-aceeditor "dev-master"

or add

"toir427/yii2-aceeditor": "*"

to the require section of your composer.json file.

Usage

Using model

\toir427\aceeditor\AceEditor::widget([
	// You can either use it for model attribute
	'model' => $my_model,
	'attribute' => 'my_field',

	// or just for input field
	'name' => 'my_input_name',

    'mode'=>'html', // programing language mode. Default "html"
    'theme'=>'github', // editor theme. Default "github"
    'readOnly'=>'true' // Read-only mode on/off = true/false. Default "false"
]);

With active field

$form->field($model, 'field')->widget(
        \toir427\aceeditor\AceEditor::className(),
        [
            'mode'=>'html', // programing language mode. Default "html"
            'theme'=>'github', // editor theme. Default "github"
            'readOnly'=>'true' // Read-only mode on/off = true/false. Default "false"
        ]
    )

Lists of all available modes and themes see here