CodeIgniter Forums
Halting script execution - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Halting script execution (/thread-2214.html)



Halting script execution - El Forum - 07-23-2007

[eluser]Glen Swinfield[/eluser]
If I were coding a script in php I might do:

Code:
if($var === false){
   $this->method();
   exit;
}

$this->otherMethod();

to avoid using too many nested if statements. Can this functionality be replicated while using CI? If you use exit() after calling a method, nothing gets processed.


Halting script execution - El Forum - 07-23-2007

[eluser]batteries[/eluser]
i do it all the time, but i use return; instead, and it works fine.


Halting script execution - El Forum - 07-23-2007

[eluser]Glen Swinfield[/eluser]
It strikes me as being completely bizzare that I didn't use return first of all.. :red:


Halting script execution - El Forum - 07-23-2007

[eluser]batteries[/eluser]
i think i made the same mistake when first using CI as well. brain farts happen. Smile