Stop controller at this point, run other method - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Stop controller at this point, run other method (/showthread.php?tid=68230) |
Stop controller at this point, run other method - krystian2160 - 06-13-2017 In index of my Main.php controller I have something like this: PHP Code: $check = $this->Logier->check_address($url); RE: Stop controller at this point, run other method - skunkbad - 06-13-2017 That's pretty much exactly the same as what you had, because you used if/else if/else. Break won't do anything for you, since you're not in a loop. If it makes you happy, use exit or die instead. RE: Stop controller at this point, run other method - Wouter60 - 06-16-2017 In some cases, switch is a better alternative: PHP Code: $check = $this->Logier->check_address($url); |