首页 > 代码库 > thinkphp---初始化

thinkphp---初始化

 protected function _initialize(){
        parent :: _initialize();
        $this -> agentid = $_SESSION[‘agentid‘];
        if (!$this -> agentid){
            $this -> error(‘没有权限‘, U(‘Login/index‘));
        }
        $this -> agent_db = M(‘Agent‘);
        $this -> thisAgent = $this -> agent_db -> where(array(‘id‘ => $this -> agentid)) -> find();
        $this -> assign(‘thisAgent‘, $this -> thisAgent);
        $this -> assign(‘menus‘, $this -> menus());
        $this -> agentWhere = array(‘agentid‘ => $this -> thisAgent[‘id‘]);
    }

thinkphp---初始化