Welcome Guest, Not a member yet? Register   Sign In
Halting script execution
#1

[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.
#2

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

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

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




Theme © iAndrew 2016 - Forum software by © MyBB