主程序cmstop类,实例化controller_admin_content类(接收请求后拼接的).传递cmstop所有属性过去.
controller_admin_content.构造方法中接收到名称为cmstop,已经内容为cmstop所有属性
class cmstop extends object{
public $app, $controller, $action, $args, $class
}
设置好属性$class.用来接收控制名.(需要拼接)如 $this->class = 'controller_admin_'.$controller;
用来实例化控制类名,$this->class就是 controller_admin_content类
$obj = new $this->class($this);
把所有属性传递传递过去$this
class controller_admin_content extends controller_abstract
{
function __construct(& $app)
{
parent::__construct($app);
触发controller_admin_content的构造方法.
$app名就是上一个类名cmstop
内容为cmstop所有属性
{
"app":"system","controller":"content","action":"page",
"args":{"app":"system","controller":"content","action":"page","catid":"841","modelid":"0","status":"6","createdby":"","pagesize":"15"},
"client":"admin",
"app_dir":"G:/Projects/tsycms/cmstop/apps/system/",
"class":"controller_admin_content",
"userid":"1",
"username":"admin",
"groupid":"1","roleid":"1",
"departmentid":"2"
}