\app\controllerOften

控制器基础类

Summary

Methods
Properties
Constants
__construct()
record()
save()
No public properties found
No constants found
initialize()
validate()
$request
$app
$batchValidate
$middleware
N/A
No private methods found
No private properties found
N/A

Properties

$request

$request : \think\Request

Request实例

Type

Request

$app

$app : \think\App

应用实例

Type

App

$batchValidate

$batchValidate : bool

是否批量验证

Type

bool

$middleware

$middleware : array

控制器中间件

Type

array

Methods

__construct()

__construct(\think\App  $app) : mixed

构造方法

Parameters

\think\App $app

应用对象

Returns

mixed —

record()

record() : mixed

Returns

mixed —

save()

save() : mixed

Returns

mixed —

initialize()

initialize() : mixed

Returns

mixed —

validate()

validate(array  $data, string|array  $validate, array  $message = [], bool  $batch = false) : array|string|true

验证数据

Parameters

array $data

数据

string|array $validate

验证器名或者验证规则数组

array $message

提示信息

bool $batch

是否批量验证

Throws

\think\exception\ValidateException

Returns

array|string|true —