\app\admin\controllerArticleController

控制器基础类

Summary

Methods
Properties
Constants
combineCate()
combineMenu()
okJson()
errJson()
listJson()
getPageSize()
getPage()
setToken()
__construct()
lists()
add()
delete()
edit()
No public properties found
No constants found
initialize()
validate()
$request
$app
$batchValidate
$middleware
N/A
articleCate()
No private properties found
N/A

Properties

$request

$request : \think\Request

Request实例

Type

\think\Request

$app

$app : \think\App

应用实例

Type

\think\App

$batchValidate

$batchValidate : boolean

是否批量验证

Type

boolean

$middleware

$middleware : array

控制器中间件

Type

array

Methods

combineCate()

combineCate(  $cate,   $pid,   $level,   $html = '--- ') 

Parameters

$cate
$pid
$level
$html

combineMenu()

combineMenu(  $menu,   $pid,   $level,   $html = '--- ') 

Parameters

$menu
$pid
$level
$html

okJson()

okJson(string  $msg = '', array  $data = array(), string  $url = '') : \think\response\Json

正确信息

Parameters

string $msg
array $data
string $url

Returns

\think\response\Json

errJson()

errJson(string  $msg = '', string  $url = '') : \think\response\Json

错误信息

Parameters

string $msg
string $url

Returns

\think\response\Json

listJson()

listJson(array  $data = array(), integer  $total) : \think\response\Json

分页数据

Parameters

array $data
integer $total

Returns

\think\response\Json

getPageSize()

getPageSize() : integer

获取分页数量

Returns

integer

getPage()

getPage() : integer

获取请求页

Returns

integer

setToken()

setToken() : string

生成api token

Returns

string

__construct()

__construct(\think\App  $app) 

构造方法

Parameters

\think\App $app

应用对象

edit()

edit() 

initialize()

initialize() 

validate()

validate(array  $data, string|array  $validate, array  $message = array(), boolean  $batch = false) : array|string|true

验证数据

Parameters

array $data

数据

string|array $validate

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

array $message

提示信息

boolean $batch

是否批量验证

Throws

\think\exception\ValidateException

Returns

array|string|true

articleCate()

articleCate()