Welcome Guest, Not a member yet? Register   Sign In
return load->view and hooks
#1

hi,
if I have method in controller and I want to finish script earlier if some condition are not met
i use
return $this->load->view('something');
will it still trigger post_controller hook or should I exit from script in different way?

thanks,
janusz
Reply
#2

The only way to bypass the post_controller hook is to use exit(), which really isn't a good idea most of the time.

Instead, you should probably find a way to disable the hook. For example, Bonfire has a list of URLs which are ignored by certain pre_controller/post_controller hooks, so the functions check the current URL against the list and return early if the URL is found in the list.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB