首页 > Web开发 > 详细

thinkphp---初始化

时间:2014-11-23 17:39:21      阅读:282      评论:0      收藏:0      [点我收藏+]

 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---初始化

原文:http://my.oschina.net/guomingliang/blog/347902

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!