\DtApp\ThinkLibraryController

标准控制器基类 Class Controller

Summary

Methods
Properties
Constants
__construct()
error()
success()
redirect()
fetch()
assign()
callback()
$app
$request
No constants found
initialize()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$app

$app : \think\App

应用容器

Type

\think\App

$request

$request : \think\Request

请求对象

Type

\think\Request

Methods

__construct()

__construct(\think\App  $app) 

Controller constructor.

Parameters

\think\App $app

error()

error(mixed  $info, mixed  $data = '{-null-}', integer  $code) 

返回失败的操作

Parameters

mixed $info

消息内容

mixed $data

返回数据

integer $code

返回代码

success()

success(mixed  $info, mixed  $data = '{-null-}', integer  $code = 1) 

返回成功的操作

Parameters

mixed $info

消息内容

mixed $data

返回数据

integer $code

返回代码

redirect()

redirect(string  $url, integer  $code = 301) 

URL重定向

Parameters

string $url

跳转链接

integer $code

跳转代码

fetch()

fetch(string  $tpl = '', array  $vars = array()) 

返回视图内容

Parameters

string $tpl

模板名称

array $vars

模板变量

assign()

assign(mixed  $name, mixed  $value = '') : $this

模板变量赋值

Parameters

mixed $name

要显示的模板变量

mixed $value

变量的值

Returns

$this

callback()

callback(string  $name, mixed  $one = array(), mixed  $two = array()) : boolean

数据回调处理机制

Parameters

string $name

回调方法名称

mixed $one

回调引用参数1

mixed $two

回调引用参数2

Returns

boolean

initialize()

initialize() 

控制器初始化