Download the PHP package wandoubaba/res without Composer
On this page you can find all versions of the php package wandoubaba/res. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download wandoubaba/res
More information about wandoubaba/res
Files in wandoubaba/res
Download wandoubaba/res
More information about wandoubaba/res
Files in wandoubaba/res
Vendor wandoubaba
Package res
Short Description 一个简单的Res模型,包含code、msg、data属性,可用于HTTP接口的返回值
License MIT
Package res
Short Description 一个简单的Res模型,包含code、msg、data属性,可用于HTTP接口的返回值
License MIT
Please rate this library. Is it a good library?
Informations about the package res
介绍
一个简单的Res模型,包含code、msg、data、time_taked属性,可用于HTTP接口的返回值。
使用方法
安装
使用
属性说明
属性 | 类型 | 举例 | 说明 |
---|---|---|---|
code | int | 200 | 状态码,默认200表示成功 |
msg | string | "操作成功" | 状态描述 |
data | mix | "Hello world." | 返回数据,可以是任意类型 |
time_taked | double | 0.000014066696166992188 | 从后端res对象创建到返回结果期间消耗的时间,单位是秒 |
内置code和msg
通过依赖注入实现自定义错误码
以
webman
框架为例。
参考
关于依赖注入的详细资料请参考:
All versions of res with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.4
php-di/php-di Version ^6.3
doctrine/annotations Version ^1.14
psr/container Version ^1.1.1
php-di/php-di Version ^6.3
doctrine/annotations Version ^1.14
psr/container Version ^1.1.1
The package wandoubaba/res contains the following files
Loading the files please wait ....