\app\controllerSummary

控制器基础类

Summary

Methods
Properties
Constants
__construct()
init()
note()
poll()
handle()
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() : mixed

Returns

mixed —

init()

init() : mixed

Returns

mixed —

note()

note(mixed  $type, mixed  $class, mixed  $mold) : mixed

Parameters

mixed $type
mixed $class
mixed $mold

Returns

mixed —

poll()

poll() : mixed

Returns

mixed —

handle()

handle(mixed  $arr) : mixed

Parameters

mixed $arr

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 —