Skip to content

Commit

Permalink
更新readme,删除了一些危险文件
Browse files Browse the repository at this point in the history
  • Loading branch information
pjkui committed Sep 8, 2020
1 parent f4e57b3 commit 768c435
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 377 deletions.
124 changes: 77 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@ KindEditor
# install
Either run

`
```bash
$ php composer.phar require pjkui/kindeditor "*"
`
```

or add

`
```php
"pjkui/kindeditor": "*"
`

```
to the `require` section of your `composer.json` file.

`'pjkui\\kindeditor\\'=>array($vendorDir . '/pjkui/kindeditor')`,
```php
'pjkui\\kindeditor\\'=>array($vendorDir . '/pjkui/kindeditor')
```

# Usage example

## add an actions() method in controller
Expand All @@ -35,7 +37,7 @@ public function actions()
}
```

##used in view :
## used in view :
```php

echo \pjkui\kindeditor\KindEditor::widget([]);
Expand All @@ -50,8 +52,12 @@ echo $form->field($model,'colum')->widget('pjkui\kindeditor\KindEditor',[]);
or :
```php
<?= $form->field($model, 'content')->widget('pjkui\kindeditor\KindEditor',
['clientOptions'=>['allowFileManager'=>'true',
'allowUpload'=>'true']])
[
'clientOptions'=>[
'allowFileManager'=>'true',
'allowUpload'=>'true'
]
])
?>
```
## configure
Expand All @@ -62,62 +68,77 @@ or :

usage:
```php
<?= $form->field($model, 'content')->widget('pjkui\kindeditor\KindEditor',
['clientOptions'=>['allowFileManager'=>'true',
'allowUpload'=>'true'
]
]) ?>
<?= $form->field($model, 'content')->widget('pjkui\kindeditor\KindEditor',
[
'clientOptions'=>[
'allowFileManager'=>'true',
'allowUpload'=>'true'
]
])
?>
```

2. `uploadButton`Kindediotr work as a upload file button ,can upload file/picture to the server automatic
2. `uploadButton` Kindediotr work as a upload file button ,can upload file/picture to the server automatic

usage:
```php
<?= $form->field($model, 'article_pic')->widget('pjkui\kindeditor\KindEditor',
['clientOptions'=>[
[
'clientOptions'=>[
'allowFileManager'=>'true',
'allowUpload'=>'true'
],
'editorType'=>'uploadButton
'editorType'=>'uploadButton
])
?>
```
3. `colorpicker`kindeditor work as color picker

usage:
```php
<?= $form->field($model, 'content')->widget('pjkui\kindeditor\KindEditor',
'editorType'=>'colorpicker'])
?>
```
4. `file-manager`kindeditor work as file manager,can view and select the file which uploaded by it .

usage:
```php
<?= $form->field($model, 'article_pic')->widget('pjkui\kindeditor\KindEditor',
['clientOptions'=>[
[
'clientOptions'=>[
'allowFileManager'=>'true',
'allowUpload'=>'true'
],
'editorType'=>'file-manager'
])
])
?>
```
5. `image-dialog`kindeditor work as image upload dialog.

usage:
```php
<?= $form->field($model, 'article_pic')->widget('pjkui\kindeditor\KindEditor',
['clientOptions'=>['allowFileManager'=>'true',
'allowUpload'=>'true'
],
'editorType'=>'image-dialog'
[
'clientOptions'=>[
'allowFileManager'=>'true',
'allowUpload'=>'true'
],
'editorType'=>'image-dialog'
])
?>
```
6. `file-dialog`kindeditor work as file upload dialog.

usage:
```php
<?= $form->field($model, 'article_pic')->widget('pjkui\kindeditor\KindEditor',
['clientOptions'=>['allowFileManager'=>'true',
'allowUpload'=>'true'],
'editorType'=>'file-dialog'
[
'clientOptions'=>[
'allowFileManager'=>'true',
'allowUpload'=>'true'
],
'editorType'=>'file-dialog'
])
?>
```
Expand Down Expand Up @@ -213,9 +234,11 @@ echo $form->field($model,'colum')->widget('pjkui\kindeditor\KindEditor',[]);

```php
<?= $form->field($model, 'content')->widget('pjkui\kindeditor\KindEditor',
['clientOptions'=>['allowFileManager'=>'true',
'allowUpload'=>'true'
]
[
'clientOptions'=>[
'allowFileManager'=>'true',
'allowUpload'=>'true'
]
])
?>
```
Expand All @@ -225,11 +248,12 @@ echo $form->field($model,'colum')->widget('pjkui\kindeditor\KindEditor',[]);

```php
<?= $form->field($model, 'article_pic')->widget('pjkui\kindeditor\KindEditor',
['clientOptions'=>[
'allowFileManager'=>'true',
'allowUpload'=>'true'
],
'editorType'=>'uploadButton
[
'clientOptions'=>[
'allowFileManager'=>'true',
'allowUpload'=>'true'
],
'editorType'=>'uploadButton
])
?>
```
Expand All @@ -238,18 +262,19 @@ echo $form->field($model,'colum')->widget('pjkui\kindeditor\KindEditor',[]);

```php
<?= $form->field($model, 'content')->widget('pjkui\kindeditor\KindEditor',
'editorType'=>'colorpicker'])
'editorType'=>'colorpicker')
?>
```
4. 配置kindeditor为文件管理器,可以查看和选着其上传的文件。
示例:

```php
<?= $form->field($model, 'article_pic')->widget('pjkui\kindeditor\KindEditor',
['clientOptions'=>[
'allowFileManager'=>'true',
'allowUpload'=>'true'
],
[
'clientOptions'=>[
'allowFileManager'=>'true',
'allowUpload'=>'true'
],
'editorType'=>'file-manager'
])
?>
Expand All @@ -259,10 +284,12 @@ echo $form->field($model,'colum')->widget('pjkui\kindeditor\KindEditor',[]);

```php
<?= $form->field($model, 'article_pic')->widget('pjkui\kindeditor\KindEditor',
['clientOptions'=>['allowFileManager'=>'true',
'allowUpload'=>'true'
],
'editorType'=>'image-dialog'
[
'clientOptions'=>[
'allowFileManager'=>'true',
'allowUpload'=>'true'
],
'editorType'=>'image-dialog'
])
?>
```
Expand All @@ -272,10 +299,13 @@ echo $form->field($model,'colum')->widget('pjkui\kindeditor\KindEditor',[]);

```php
<?= $form->field($model, 'article_pic')->widget('pjkui\kindeditor\KindEditor',
['clientOptions'=>['allowFileManager'=>'true',
'allowUpload'=>'true'],
'editorType'=>'file-dialog'
])
[
'clientOptions'=>[
'allowFileManager'=>'true',
'allowUpload'=>'true'
],
'editorType'=>'file-dialog'
])
?>
```

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pjkui/kindeditor",
"description": "desc",
"description": "Yii2 可以使用的KindEditor富文本编辑器。 KindEditor for Yii2",
"license": "MIT",
"authors": [
{
Expand Down
53 changes: 0 additions & 53 deletions php/demo.php

This file was deleted.

Loading

0 comments on commit 768c435

Please sign in to comment.