Skip to content

Commit fc61a3e

Browse files
authored
Update WebmanReadme.md
1 parent 9d83ecb commit fc61a3e

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

WebmanReadme.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,15 @@
66
$ composer require zhenmu/support -vvv
77
```
88

9-
## 基类创建控制器
10-
11-
```php
12-
./webman plugin:install zhen-mu/support
13-
14-
or
15-
16-
php ./vendor/zhenmu/support/src/scripts/install.php
17-
```
18-
199
## 使用
2010

21-
### 控制器
22-
2311
1. 通过 `./webman make:controller` 控制器生成后,继承同目录下的 `WebmanBaseController` 基类。
2412
2. 编写接口时可通过 `$this->success($data = [], $err_code = 200, $messsage = 'success');` 返回正确数据给接口。
2513
3. 编写接口时可通过 `$this->fail($messsage = '', $err_code = 400);` 返回错误信息给接口。
26-
4.`support/exception/Handler.php``render` 函数中,调用 `WebmanResponseTrait``$this->renderableHandle($request, $exception);` 示例如下:
14+
4.`support/exception/Handler.php``render` 函数中,调用 `WebmanResponseTrait``$this->renderableHandle($request, $exception);` 示例见下方错误处理。
15+
16+
17+
### 控制器
2718

2819
```php
2920
<?php

0 commit comments

Comments
 (0)