slexx/yii2-aceeditor

Yii2 ajax.org Ace Editor 组件

安装: 5

依赖者: 0

建议者: 0

安全: 0

星标: 1

关注者: 2

分支: 0

开放问题: 0

类型:yii2-extension

v1.0.0 2020-02-27 10:54 UTC

This package is auto-updated.

Last update: 2024-09-27 21:11:48 UTC


README

使用方法

使用模型

trntv\aceeditor\Widget::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"

	// Editor container options
	'containerOptions' => [
		'toolbar' => false,
		'css' => 'wym.css',
	],
]);

与活动字段一起使用

$form->field($model, 'field', ['enableClientValidation'=>false])
    ->widget(
        'trntv\aceeditor\Widget',
        [
            'mode' => 'mode',
            ...
        ]
    )

安装

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

运行以下命令之一:

php composer.phar require slexx/yii2-aceeditor "*"

或者在您的 composer.json 文件的 require 部分添加:

"slexx/yii2-aceeditor": "*"

```