APP_PATH
APP_PATH = __DIR__ . '/../application/'
| app |
| Composer |
| PHP_CodeSniffer |
| PHPMailer |
| think |
| traits |
| Workerman |
| ComposerAutoloaderInit6d5558861a45ebae8bd07752559b5b0c | |
| Error |
abort(integer|\think\Response $code, string $message = null, array $header = array())
抛出HTTP异常
| integer|\think\Response | $code | 状态码 或者 Response对象实例 |
| string | $message | 错误信息 |
| array | $header | 参数 |
collection(array $resultSet) : \think\model\Collection|\think\Collection
数组转换为数据集对象
| array | $resultSet | 数据集数组 |
controller(string $name, string $layer = 'controller', boolean $appendSuffix = false) : \think\Controller
实例化控制器 格式:[模块/]控制器
| string | $name | 资源地址 |
| string | $layer | 控制层名称 |
| boolean | $appendSuffix | 是否添加类名后缀 |
json(mixed $data = array(), integer $code = 200, array $header = array(), array $options = array()) : \think\response\Json
获取\think\response\Json对象实例
| mixed | $data | 返回的数据 |
| integer | $code | 状态码 |
| array | $header | 头部 |
| array | $options | 参数 |
jsonp(mixed $data = array(), integer $code = 200, array $header = array(), array $options = array()) : \think\response\Jsonp
获取\think\response\Jsonp对象实例
| mixed | $data | 返回的数据 |
| integer | $code | 状态码 |
| array | $header | 头部 |
| array | $options | 参数 |
model(string $name = '', string $layer = 'model', boolean $appendSuffix = false) : \think\Model
实例化Model
| string | $name | Model名称 |
| string | $layer | 业务层名称 |
| boolean | $appendSuffix | 是否添加类名后缀 |
redirect(mixed $url = array(), array|integer $params = array(), integer $code = 302, array $with = array()) : \think\response\Redirect
获取\think\response\Redirect对象实例
| mixed | $url | 重定向地址 支持Url::build方法的地址 |
| array|integer | $params | 额外参数 |
| integer | $code | 状态码 |
| array | $with | 隐式传参 |
request() : \think\Request
获取当前Request对象实例
response(mixed $data = array(), integer|string $code = 200, array $header = array(), string $type = 'html') : \think\Response
创建普通 Response 对象实例
| mixed | $data | 输出数据 |
| integer|string | $code | 状态码 |
| array | $header | 头信息 |
| string | $type |
validate(string $name = '', string $layer = 'validate', boolean $appendSuffix = false) : \think\Validate
实例化验证器
| string | $name | 验证器名称 |
| string | $layer | 业务层名称 |
| boolean | $appendSuffix | 是否添加类名后缀 |
xml(mixed $data = array(), integer $code = 200, array $header = array(), array $options = array()) : \think\response\Xml
获取\think\response\Xml对象实例
| mixed | $data | 返回的数据 |
| integer | $code | 状态码 |
| array | $header | 头部 |
| array | $options | 参数 |