Property | Type | Description | |
---|---|---|---|
$batchValidate | 是否批量验证 | ||
$beforeActionList | array | 前置操作方法列表 | |
$failException | 验证失败是否抛出异常 | ||
$request | Request实例 | ||
$view | 视图类实例 |
Method | Description | |
---|---|---|
__construct ( think\Request $request = null ) | 架构函数 |
Method | Description | |
---|---|---|
_initialize ( ) | 初始化 | |
assign ( mixed $name, mixed $value = '' ) : void | 模板变量赋值 | |
beforeAction ( string $method, array $options = [] ) | 前置操作 | |
display ( string $content = '', array $vars = [], array $replace = [], array $config = [] ) : mixed | 渲染内容输出 | |
engine ( array | string $engine ) : void | 初始化模板引擎 | |
fetch ( string $template = '', array $vars = [], array $replace = [], array $config = [] ) : mixed | 加载模板输出 | |
validate ( array $data, string | array $validate, array $message = [], boolean $batch = false, mixed $callback = null ) : array | string | true | 验证数据 | |
validateFailException ( boolean $fail = true ) | 设置验证失败后是否抛出异常 |
public __construct ( think\Request $request = null ) | ||
$request | think\Request | Request对象 |
protected beforeAction ( string $method, array $options = [] ) | ||
$method | string | 前置操作方法名 |
$options | array | 调用参数 ['only'=>[...]] 或者['except'=>[...]] |
protected validate ( array $data, string | array $validate, array $message = [], boolean $batch = false, mixed $callback = null ) : array | string | true | ||
$data | array | 数据 |
$validate | string | array | 验证器名或者验证规则数组 |
$message | array | 提示信息 |
$batch | boolean | 是否批量验证 |
$callback | mixed | 回调方法(闭包) |
return | array | string | true |
protected validateFailException ( boolean $fail = true ) | ||
$fail | boolean | 是否抛出异常 |