声明全局属性

protected $archives;//声明全局属性
    protected $person;
    protected $archives_detail;
    function _initialize(){//初始化类
        parent::_initialize();//调用父类
        set_time_limit(0);//持续运行到程序结束
        $this->archives = M('archives');//创建对象
        $this->archives_detail = M('archives_detail');
        $this->person = M('person');
    }

你可能感兴趣的:(声明全局属性)