CodeIgniter Forums
Anyway to stop a controller from processing data after a view is loaded? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Anyway to stop a controller from processing data after a view is loaded? (/showthread.php?tid=10067)



Anyway to stop a controller from processing data after a view is loaded? - El Forum - 07-17-2008

[eluser]kwhitaker[/eluser]
Good afternoon all,

I've got a controller that has logic like this:

Code:
if(some logic)
{
  do some action
}
else
{
   if(some other logic)
   {
     do some other action
     load a view
   }

   Assuming that the above doesn't apply, process the controller accordingly.
}

The problem that I'm having right now is that the page continues to process data, even if the view is loaded. Is there anyway to stop the data from processing after the view is loaded, without nesting all of the code past the second if statement into an else?


Anyway to stop a controller from processing data after a view is loaded? - El Forum - 07-17-2008

[eluser]m4rw3r[/eluser]
use return; it makes the controller action exit.