Class Action

Description

ThinkPHP Action控制器基类 抽象类

Located in /Think/Core/Action.class.php (line 24)

Base
   |
   --Action
Variable Summary
mixed $error
mixed $name
mixed $tpl
Method Summary
Action __construct ()
void ajaxReturn ([mixed $data = ''], [String $info = ''], [String $status = ''], [ $type = ''])
void assign (mixed $name, [mixed $value = ''])
string cacheLockVersion (mixed $data)
void display ([string $templateFile = ''], [string $charset = ''], [string $contentType = 'text/html'], [string $varPrefix = ''])
void error (string $errorMsg, [Boolean $ajax = false])
void fetch ([string $templateFile = ''], [string $charset = ''], [string $contentType = 'text/html'], [string $varPrefix = ''])
void forward ([mixed $action = '_dispatch_jump'], [string $module = MODULE_NAME], [string $app = APP_NAME], [boolean $exit = false], [integer $delay = 0])
mixed get (string $name)
string getActionName ()
mixed getModelClass ()
string getReturnUrl ()
void isAjax ()
void layout (string $templateFile, [string $charset = ''], [string $contentType = 'text/html'], [string $varPrefix = ''], [boolean $display = true])
void redirect (string $action, [string $module = MODULE_NAME], [string $route = ''], [string $app = APP_NAME], [array $params = array()], [integer $delay = 0], [string $msg = ''])
void success (string $message, [Boolean $ajax = false])
void trace (mixed $name, [mixed $value = ''])
void _initialize ()
void __get ( $name)
void __set ( $name,  $value)
Variables
mixed $error (line 37)
  • access: protected
mixed $name (line 28)
  • access: protected
mixed $tpl (line 31)
  • access: protected
mixed $_cacheAction = array() (line 34)
  • access: protected
Methods
Constructor __construct (line 46)

架构函数 取得模板对象实例

  • access: public
Action __construct ()
ajaxReturn (line 389)

Ajax方式返回数据到客户端

  • access: public
void ajaxReturn ([mixed $data = ''], [String $info = ''], [String $status = ''], [ $type = ''])
  • mixed $data: 要返回的数据
  • String $info: 提示信息
  • String $status: ajax返回类型 JSON XML
  • $type
assign (line 252)

模板变量赋值

  • access: public
void assign (mixed $name, [mixed $value = ''])
  • mixed $name: 要显示的模板变量
  • mixed $value: 变量的值
cacheLockVersion (line 126)

记录乐观锁

  • throws: ThinkExecption
  • access: protected
string cacheLockVersion (mixed $data)
  • mixed $data: 数据对象
display (line 186)

模板显示

调用内置的模板引擎显示方法,

  • access: public
void display ([string $templateFile = ''], [string $charset = ''], [string $contentType = 'text/html'], [string $varPrefix = ''])
  • string $templateFile: 指定要调用的模板文件 默认为空 由系统自动定位模板文件
  • string $charset: 输出编码
  • string $contentType: 输出类型
  • string $varPrefix: 模板变量前缀
error (line 343)

操作错误跳转的快捷方法

  • access: public
void error (string $errorMsg, [Boolean $ajax = false])
  • string $errorMsg: 错误信息
  • Boolean $ajax: 是否为Ajax方式
fetch (line 214)

获取输出页面内容

调用内置的模板引擎fetch方法,

  • access: public
void fetch ([string $templateFile = ''], [string $charset = ''], [string $contentType = 'text/html'], [string $varPrefix = ''])
  • string $templateFile: 指定要调用的模板文件 默认为空 由系统自动定位模板文件
  • string $charset: 输出编码
  • string $contentType: 输出类型
  • string $varPrefix: 模板变量前缀
forward (line 436)

执行某个Action操作(隐含跳转) 支持指定模块和延时执行

  • access: public
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: 延时跳转的时间 单位为秒
get (line 285)

取得模板显示变量的值

  • access: public
mixed get (string $name)
  • string $name: 模板显示变量
getActionName (line 64)

得到当前的Action对象名称

  • access: public
string getActionName ()
getModelClass (line 147)

取得数据访问类的实例

  • throws: ThinkExecption
  • access: protected
mixed getModelClass ()
getReturnUrl (line 165)

取得操作成功后要返回的URL地址

默认返回当前模块的默认操作

  • throws: ThinkExecption
  • access: protected
string getReturnUrl ()
isAjax (line 101)
  • access: protected
void isAjax ()
layout (line 235)

输出布局页面内容

调用内置的模板引擎fetch方法,

  • access: public
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: 是否输出
redirect (line 478)

Action跳转(URL重定向) 支持指定模块和延时跳转

  • access: public
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: 跳转提示信息
success (line 365)

操作成功跳转的快捷方法

  • access: public
void success (string $message, [Boolean $ajax = false])
  • string $message: 提示信息
  • Boolean $ajax: 是否为Ajax方式
trace (line 269)

Trace变量赋值

  • access: public
void trace (mixed $name, [mixed $value = ''])
  • mixed $name: 要显示的模板变量
  • mixed $value: 变量的值
_initialize (line 88)

控制器初始化操作

  • throws: ThinkExecption
  • access: protected
void _initialize ()
__get (line 294)
  • access: protected
void __get ( $name)
  • $name
__set (line 290)
  • access: protected
void __set ( $name,  $value)
  • $name
  • $value

Documentation generated on Thu, 27 Mar 2008 08:20:20 +0000 by 塞北的雪