diff --git a/README.md b/README.md index 5426120..996da11 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,69 @@ -Yii2 wangeditor widget +Yii2 wangEditor widget ====================== -Yii2 wangeditor widget -Installation ------------- +Yii2 wangEditor widget -The preferred way to install this extension is through [composer](http://getcomposer.org/download/). +[wangEditor 官网](http://www.wangeditor.com/) -Either run +安装 +------------ ``` php composer.phar require --prefer-dist kriss/yii2-wang-editor "*" ``` -or add +使用 +----- -``` -"kriss/yii2-wang-editor": "*" +基本当 widget 使用: + +```php +echo \kriss\wangEditor\WangEditorWidget::widget([ + 'name' => 'inputName', +]); ``` -to the require section of your `composer.json` file. +放在 ActiveForm 中使用: +```php +$form = new \yii\widgets\ActiveForm(); +echo $form->field($model, 'content')->widget(\kriss\wangEditor\WangEditorWidget::className()); +``` -Usage +配置 ----- -Once the extension is installed, simply use it in your code by : +## clientJs 客户端 js 扩展 + +可替换变量: + + - `{name}`:editor实例 + - `{hiddenInputId}`:隐藏输入域的id + +配置举例: + +```php +'clientJs' => <<``` \ No newline at end of file +$clientJs = << 'content', + 'clientJs' => $clientJs +]); +``` \ No newline at end of file