slexx / yii2-aceeditor
Yii2 ajax.org Ace Editor 组件
v1.0.0
2020-02-27 10:54 UTC
Requires
- yiisoft/yii2: *
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": "*"
```