ThinkPHP5


think\response\View
library\think\response\View.php at line 18

Class View

Response
└─View

public class View
extends Response


Method Summary
protected mixed

output(mixed data)

处理数据

mixed

getVars(string name)

获取视图变量

$this

assign(mixed name, mixed value)

模板变量赋值

$this

replace(string|array content, string replace)

视图内容替换

Methods inherited from think\Response
__construct, cacheControl, code, content, contentType, create, data, eTag, expires, getCode, getContent, getData, getHeader, header, lastModified, options, output, send

Method Detail

library\think\response\View.php at line 32

output

protected mixed output(mixed data)

处理数据

Parameters:
data - 要处理的数据

library\think\response\View.php at line 45

getVars

public mixed getVars(string name)

获取视图变量

Parameters:
name - 模板变量

library\think\response\View.php at line 61

assign

public $this assign(mixed name, mixed value)

模板变量赋值

Parameters:
name - 变量名
value - 变量值

library\think\response\View.php at line 79

replace

public $this replace(string|array content, string replace)

视图内容替换

Parameters:
content - 被替换内容(支持批量替换)
replace - 替换内容

ThinkPHP5