系统类库
[ 查看开发文档 ] [ 类树图: Library ] [ 索引: Library ] [ 所有元素 ] [ 首页 ]

Class: View

源文件路径: /Library/View.class.php

Class Overview


系统视图类


Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 10]
系统视图类


[ Top ]


Class Variables

$tVar = []

[line 16]

模板输出变量
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 41]

View __construct( Application $context)

设置应用上下文对象
  • Access: public

Parameters:

\Library\Application   $context   — 

[ Top ]

assign   [line 83]

void assign( mixed $name, [mixed $value = ''])

模板变量赋值
  • Access: public

Parameters:

mixed   $name   — 
mixed   $value   — 

[ Top ]

display   [line 119]

mixed display( [string $file = ''], [string|array $data = ''])

加载模板和页面输出 可以返回输出内容
  • Access: public

Parameters:

string   $file   —  需要渲染的文件名
string|array   $data   —  渲染输出的内容,如果为空字符串则使用文件渲染,如果为数组则为模板变量

[ Top ]

fetch   [line 134]

string fetch( [string $file = ''], [string|array $data = ''])

解析和获取模板内容 用于输出
  • Access: public

Parameters:

string   $file   —  需要渲染的文件名
string|array   $data   —  渲染输出的内容,如果为空字符串则使用文件渲染,如果为数组则为模板变量

[ Top ]

get   [line 99]

mixed get( [string $name = ''], [boolean $isClear = true])

取得模板变量的值
  • Access: public

Parameters:

string   $name   —  变量名称,默认获取所有模板变量
boolean   $isClear   —  输出所有变量后,是否清理模板变量

[ Top ]

getContext   [line 54]

\Library\Application getContext( )

获取应用上下文对象
  • Access: public

[ Top ]

getPager   [line 66]

array getPager( [array $config = []], [int $setPages = 10], [string $urlRule = ''], [array $array = []])

获取列表分页
  • Return: 分页配置,包括html和info字段
  • Access: public

Parameters:

array   $config   —  分页信息参数配置
int   $setPages   —  显示页数(可选),默认:10
string   $urlRule   —  包含变量的URL规则模板(可选),默认:{type}={page}
array   $array   —  附加的参数(可选)

[ Top ]

render   [line 178]

mixed render( \Library\Controller $concrete, string $method, [array $param = []])

渲染输出控制器方法的返回值
  • Access: public

Parameters:

\Library\Controller   $concrete   — 
string   $method   — 
array   $param   — 

[ Top ]

resolvePath   [line 219]

string resolvePath( [string $template = ''])

自动定位模板文件
  • Access: public

Parameters:

string   $template   —  模板文件规则

[ Top ]


Powered by Steeze. author email: spring.wind2006@163.com