在abstract类默认进行了系统信息的获取和设置,对继承自该类的控制器提供如下方法与变量:
§ 属性
$this->_userid;            //当前用户ID 
 $this->_username;                  //当前用户名 
 $this->_roleid;                         //当前用户角色ID 
 $this->_groupid;                     //当前用户组ID 
 $this->_departmentid; //当前用户部门ID 
 $this->config;                         //全局基本配置(数组) 
 $this->setting;                        //当前App应用配置(数组) 
 $this->system;                        //系统应用配置(数组)  
§ JSON
$this->json;                                                                //JSON 对象
 $data = $this->json->encode( $data );                      //JSON 加密
 $data = $this->json->decode( $data );                      //JSON 解密
§ 后台视图
$this->view;                                                               //视图对象 
 $this->view->assign( 'varname' , $value );                   //注册模板变量 
 $this->view->assign( $array );                        //把数组注册为变量 
 $this->view->display( 'category/index' );                    //直接显示解析后的 category/index 模板内容 
 $data = $this->view->fetch( 'category/index' );         //获取解析后的 category/index 模板内容到变量
§ 前台模板
$this->template;                                                         //视图对象 
 $this->template>assign( 'varname' , $value );  //注册模板变量 
 $this->template>assign( $array );                               //把数组注册为变量 
 $this->template>display( 'system/index.html' );          //直接显示解析后的 system/index.html 模板内容
 $data = $this->template>fetch( 'system/index.html' );           //获取解析后的 system/index.html 模板内容到变量获取
§ 其它方法
$this->is_get();                                    //判断是否为GET请求
 $this->is_post();                                              //判断是否为POST请求
 $this->is_ajax();                                              //判断是否为AJAX请求
 $this->is_head();                                             //判断是否为HEAD请求 
 $this->is_put();                                    //判断是否为PUT请求 
 $this->is_delete();                                           //判断是否为DELETE请求 
 $this->encode( $state , $info );                       //输出 json 并exit 
 $this->_error_out( $msg );                              //根据请求类型,输出错误信息
  
 // 执行另外一个 action
 $this->forward( $app , $controller , $action , array $args = array());
  
 // URL跳转
 $this->redirect( $app , $controller , $action , array $args = array());
  
 // 显示提示信息并且停止执行
 $this->showmessage( $message , $url = null , $ms = 2000 );