ManageAction::_initialize PHP Method

_initialize() public method

模块初始化,获取当前用户管理的应用
public _initialize ( )
    public function _initialize()
    {
        $this->appList = model('App')->getManageApp($this->mid);
        if (empty($this->appList)) {
            $this->error(L('PUBLIC_NO_FRONTPLATFORM_PERMISSION'));
        }
    }

Usage Example

 protected function _initialize()
 {
     parent::_initialize();
     $this->rest_id = $_SESSION['manage_dine_branch'];
     if (!empty($this->rest_id)) {
         $sql = "select rl.name, rl.id from  tp_dine_restlist as rl  where rl.status = 1 AND rl.token='{$this->token}' and rl.id={$this->rest_id};";
         $Model = new Model();
         $rest = $Model->query($sql);
         if ($rest != false) {
             $this->rest_id = $rest[0]['id'];
             $this->assign('branch_name', $rest[0]['name']);
             $this->branch_name = $rest[0]['name'];
         } else {
             exit;
         }
     } else {
         $sql = "select rl.name, rl.id from  tp_dine_restlist as rl  where rl.status = 1 AND rl.token='{$this->token}' LIMIT 1;";
         $Model = new Model();
         $rest = $Model->query($sql);
         if ($rest != false) {
             $this->rest_id = $rest[0]['id'];
             $this->assign('branch_name', $rest[0]['name']);
         } else {
             exit;
         }
     }
     $user_agent = $_SERVER['HTTP_USER_AGENT'];
     if (ereg('Mozilla', $user_agent) && ereg('MSIE', $user_agent)) {
         $this->assign('is_ie', 1);
     } else {
         $this->assign('is_ie', 0);
     }
 }
All Usage Examples Of ManageAction::_initialize