Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop execution after call $this->load->view()

In Codeigniter, How could we stop the execution after load a view?

I have tried this

function index() {
    $this->load->view('myView');
    die();

    //do not execute next code
}

but it resulting blank screen.

like image 910
Wildan Muhlis Avatar asked Jun 26 '13 10:06

Wildan Muhlis


1 Answers

https://www.codeigniter.com/user_guide/general/views.html

There is a third optional parameter lets you change the behavior of the function so that it returns data as a string rather than sending it to your browser. This can be useful if you want to process the data in some way.

echo $this->load->view('myView', '', TRUE);
    die();
like image 91
Sefus Avatar answered Oct 13 '22 15:10

Sefus