xutl/yii2-ace-widget

The ace extension for the Yii framework

Installs: 73

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:JavaScript

Type:yii2-extension

1.1.0 2016-11-04 09:49 UTC

This package is auto-updated.

Last update: 2024-04-11 01:36:40 UTC


README

该插件非免费插件也不授权任何人使用。

安装

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist xutl/yii2-ace-widget

or add

"xutl/yii2-ace-widget": "~1.0"

to the require section of your composer.json.

使用

一但安装了该扩展,可以使用下面的代码调用编辑器 :

<?= \xutl\ace\AceEdit::widget(
    [
        'mode'=>'html',
        'theme'=>'github',
        'containerOptions'=>[
            'style'=>'width: 100%; min-height: 400px',
        ]
    ]
); ?>

在表单中使用

<?= \xutl\ace\AceEditInput::widget(
    [
        'model'=>$model,
        'attribute'=>$attribute,
        'mode'=>'html',
        'theme'=>'github',
        'containerOptions'=>[
            'style'=>'width: 100%; min-height: 400px',
        ]
    ]
); ?>

<?= $form->field($model, 'content')->widget(\xutl\ace\AceEditInput::className(),
        [
            'mode' => 'text',
            'theme' => 'chrome'
        ]); ?>