取得模板对象实例
static Template
getInstance
()
View
__construct
([ $type = ''])
模板变量赋值
void
assign
(mixed $name, [mixed $value = ''])
检查缓存文件是否有效
如果无效则需要重新编译
boolen
checkCache
(string $tmplTemplateFile)
-
string
$tmplTemplateFile: 模板文件名
加载模板和页面输出 可以返回输出内容
mixed
display
([string $templateFile = ''], [string $charset = ''], [string $contentType = 'text/html'], [string $varPrefix = ''])
-
string
$templateFile: 模板文件名 留空为自动获取
-
string
$charset: 模板输出字符集
-
string
$contentType: 输出类型
-
string
$varPrefix: 模板变量前缀
加载模板和页面输出
void
fetch
([string $templateFile = ''], [string $charset = ''], [string $contentType = 'text/html'], [string $varPrefix = ''], [ $display = false], integer $mode)
-
string
$templateFile: 模板文件名 留空为自动获取
-
string
$charset: 模板输出字符集
-
string
$contentType: 输出类型
-
string
$varPrefix: 模板变量前缀
-
integer
$mode: 0 返回 1 输出 2 下载
-
$display
取得模板变量的值
mixed
get
(string $name)
输出布局模板
void
layout
( $layoutFile, [string $charset = ''], [string $contentType = 'text/html'], [string $varPrefix = ''], [string $display = true], string $layout)
-
string
$layout: 指定要输出的布局模板
-
string
$charset: 输出编码
-
string
$contentType: 输出类型
-
string
$varPrefix: 模板变量前缀
-
string
$display: 是否直接显示
-
$layoutFile
显示运行时间、数据库操作、缓存次数、内存使用信息
string
showTime
(string $startTime)
Trace变量赋值
void
trace
( $title, [mixed $value = ''], mixed $name)
-
mixed
$name
-
mixed
$value
-
$title