看看这段代码:
$this->session->set_flashdata('prev_page', $this->uri->uri_string());
echo $this->uri->uri_string();
echo $this->session->flashdata('prev_page');
参观时mywebsite/index.php/home/
echo $this->uri->uri_string();
印刷home
echo $this->session->flashdata('prev_page');
打印home/picktype
,在同一个控制器中完全不同的功能!
有问题的控制器功能:
class Home extends MY_Controller {
function __construct()
{
parent::__construct();
}
public function index()
{
if($this->input->cookie('disclaimer_seen_token'))
{
$this->load->view('home');
} else {
redirect('disclaimer');
}
}
public function picktype()
{
$this->load->view('picktype');
}
}
为什么会发生这种情况?