PHP/codeigniter - use of exit()

前端 未结 8 1014
不思量自难忘°
不思量自难忘° 2020-12-28 16:46

I have a few pages that require login, so all controllers that link to these pages start with

$this->checkSession();
//...rest of the code
8条回答
  •  一整个雨季
    2020-12-28 17:02

    I had a similar problem. Where I wanted to stop the user to due to no login. But I wanted to offer a list of links for them not simply redirect them to a login page. I am using CI version 1.7.2 and the $this->_output() $this->display->_output() and $this->output->_display() solutions did not work for me. I was however to get my results using the $this->output->get_output() function.

            $this->load->vars($data);
            $this->load->view('template');
            die($this->output->get_output());
    

提交回复
热议问题