架构函数 取得模板对象实例
Action
__construct
()
Ajax方式返回数据到客户端
void
ajaxReturn
([mixed $data = ''], [String $info = ''], [String $status = ''], [ $type = ''])
-
mixed
$data: 要返回的数据
-
String
$info: 提示信息
-
String
$status: ajax返回类型 JSON XML
-
$type
模板变量赋值
void
assign
(mixed $name, [mixed $value = ''])
-
mixed
$name: 要显示的模板变量
-
mixed
$value: 变量的值
记录乐观锁
string
cacheLockVersion
(mixed $data)
模板显示
调用内置的模板引擎显示方法,
void
display
([string $templateFile = ''], [string $charset = ''], [string $contentType = 'text/html'], [string $varPrefix = ''])
-
string
$templateFile: 指定要调用的模板文件 默认为空 由系统自动定位模板文件
-
string
$charset: 输出编码
-
string
$contentType: 输出类型
-
string
$varPrefix: 模板变量前缀
操作错误跳转的快捷方法
void
error
(string $errorMsg, [Boolean $ajax = false])
-
string
$errorMsg: 错误信息
-
Boolean
$ajax: 是否为Ajax方式
获取输出页面内容
调用内置的模板引擎fetch方法,
void
fetch
([string $templateFile = ''], [string $charset = ''], [string $contentType = 'text/html'], [string $varPrefix = ''])
-
string
$templateFile: 指定要调用的模板文件 默认为空 由系统自动定位模板文件
-
string
$charset: 输出编码
-
string
$contentType: 输出类型
-
string
$varPrefix: 模板变量前缀
执行某个Action操作(隐含跳转) 支持指定模块和延时执行
void
forward
([mixed $action = '_dispatch_jump'], [string $module = MODULE_NAME], [string $app = APP_NAME], [boolean $exit = false], [integer $delay = 0])
-
mixed
$action: 要跳转的Action 默认为_dispatch_jump
-
string
$module: 要跳转的Module 默认为当前模块
-
string
$app: 要跳转的App 默认为当前项目
-
boolean
$exit: 是否继续执行
-
integer
$delay: 延时跳转的时间 单位为秒
取得模板显示变量的值
mixed
get
(string $name)
得到当前的Action对象名称
string
getActionName
()
取得数据访问类的实例
mixed
getModelClass
()
取得操作成功后要返回的URL地址
默认返回当前模块的默认操作
string
getReturnUrl
()
输出布局页面内容
调用内置的模板引擎fetch方法,
void
layout
(string $templateFile, [string $charset = ''], [string $contentType = 'text/html'], [string $varPrefix = ''], [boolean $display = true])
-
string
$templateFile: 指定要调用的布局模板文件
-
string
$charset: 输出编码
-
string
$contentType: 输出类型
-
string
$varPrefix: 模板变量前缀
-
boolean
$display: 是否输出
Action跳转(URL重定向) 支持指定模块和延时跳转
void
redirect
(string $action, [string $module = MODULE_NAME], [string $route = ''], [string $app = APP_NAME], [array $params = array()], [integer $delay = 0], [string $msg = ''])
-
string
$action: 要跳转的Action
-
string
$module: 要跳转的Module 默认为当前模块
-
string
$app: 要跳转的App 默认为当前项目
-
string
$route: 路由名
-
array
$params: 其它URL参数
-
integer
$delay: 延时跳转的时间 单位为秒
-
string
$msg: 跳转提示信息
操作成功跳转的快捷方法
void
success
(string $message, [Boolean $ajax = false])
-
string
$message: 提示信息
-
Boolean
$ajax: 是否为Ajax方式
Trace变量赋值
void
trace
(mixed $name, [mixed $value = ''])
-
mixed
$name: 要显示的模板变量
-
mixed
$value: 变量的值
控制器初始化操作
void
_initialize
()
void
__set
( $name, $value)