使用未定义的常量Panel_Controller - 假设'Panel_Controller

问题描述 投票:0回答:2

上传Codeigniter内置的应用程序我面临错误

“使用未定义的常量Panel_Controller - 假设'Panel_Controller”

defined('BASEPATH') OR exit('No direct script access allowed');

class Login_Controller extends CI_Controller {

    public function __construct(){
      parent::__construct();
      $this->load->library('javascript');
      $this->load->library('form_validation');
      $this->load->library('email');
      $this->load->library('session');

      if($this->session->userdata('id'))
      {
            return redirect(Panel_Controller);

      }
codeigniter web-hosting
2个回答
2
投票
First load the url helper in your construct by 
 $this->CI->load->helper('url'); 

if($this->session->userdata('id')){
   redirect('Panel_Controller');
}

0
投票

首先,尝试制定路线

$route['dashboard'] = "Panel_Controller/index";

然后

if($this->session->userdata('id')){
   redirect('dashboard');
}

要么

if($this->session->userdata('id')){
   redirect('Panel_Controller/index', 'refresh');
}
© www.soinside.com 2019 - 2024. All rights reserved.