xutl/yii2-ace-widget
Yii 框架的 ace 扩展
1.1.0
2016-11-04 09:49 UTC
Requires
- php: >=5.4.0
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-09-11 02:34:45 UTC
README
该插件不是免费插件,也不授权任何人使用。
安装
安装此扩展的首选方式是通过 composer。
可以运行以下命令:
composer require --prefer-dist xutl/yii2-ace-widget
或者添加以下代码到您的 composer.json
文件的 require
部分:
"xutl/yii2-ace-widget": "~1.0"
使用
一旦安装了该扩展,可以使用以下代码调用编辑器
<?= \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' ]); ?>