toir427/yii2-aceeditor

Yii2 ajax.org Ace Editor 小部件

安装: 94

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

公开问题: 0

类型:yii2-extension

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

This package is auto-updated.

Last update: 2024-09-26 20:48:59 UTC


README

关于

它是为 Yii2 框架集成的 Ace Editor

演示

Ace Editor 演示可以在 这里 找到

安装

安装此扩展的首选方式是通过 composer

运行以下命令之一:

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

或添加以下内容到您的 composer.json 文件的 require 部分:

"toir427/yii2-aceeditor": "*"

使用方法

使用模型

\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"
]);

带有活动字段

$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"
        ]
    )

所有可用模式和主题的列表,请参阅 这里