In Codeigniter, How could we stop the execution after load a view?
I have tried this
function index() {
$this->load->view(\'myView\');
I know I'm late but I came across this whilst searching to find out if loading a view stops execution but apparently it does not.
It might still be useful to someone so... To stop execution after loading a view, you can just return:
$this->load->view('myView');
return;
This will not stop PHP (unlike die()
or exit()
), CI will load the view as it normally would and any following code will not run.