选择语言 :

Core_Controller

控制器核心类

API - Core_Controller

author
呼吸二氧化碳 jonwang@myqee.com
category
MyQEE
package
System
subpackage
Core
copyright
Copyright © 2008-2013 myqee.com
license
http://www.myqee.com/license.html

$this->__construct( )


$this->_callback_set_vars( $data )

用于给系统调用设置对象变量

参数列表

参数 类型 描述 默认值
$data array $data

$this->_callback_get_vars( )

用于给系统调用获取控制器变量


$this->session( )

返回Session对象

返回值
  • Session

$this->show_message( $msg , $code = 0, $data = array ( ))

显示信息

参数列表

参数 类型 描述 默认值
$msg string $message
$code int $code integer 0
$data unknown array(0)

$this->show_success( $message = 'success', $data = array ( ))

输出成功信息

参数列表

参数 类型 描述 默认值
$message string $message string(7) "success"
$data unknown array(0)

$this->show_error( )


Controller::execute( $uri , $print = true, $use_route = true, $is_internal = true)

执行新控制

若采用非内部调用,则会等同于浏览器的URI执行,请注意防止陷入死循环

参数列表

参数 类型 描述 默认值
$uri string 新的uri
$print boolean 是否直接输出 bool true
$use_route boolean 是否在路由中寻找,默认:是 bool true
$is_internal boolean 是否内部调用,默认:是 bool true
返回值
  • string 返回新控制器执行的html

Controller::redirect( $url , $code = 302)

页面跳转

参数列表

参数 类型 描述 默认值
$url string Redirect location
$code integer Status code: 301, 302, etc integer 302
返回值
  • void

Controller::header_cache( $time = 86400)

页面输出header缓存

0表示不缓存

参数列表

参数 类型 描述 默认值
$time int 缓存时间,单位秒 integer 86400