![]() |
Interesting behaviour - 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: Interesting behaviour (/showthread.php?tid=25756) |
Interesting behaviour - El Forum - 12-23-2009 [eluser]Unknown[/eluser] I have a seemingly simple controller method that inserts a database record, and moves to an edit method: Code: public function create_ca($ca_type_id = 0) The ca model has a create_ca method as well: Code: public function create_ca($ca_type_id, $problem = "") The controller method is triggered with a url ending with /ca/create_ca/4. The funny behavior is that the create_ca in the controller appears to be triggered three times. While debugging the behavior, I noticed that if I inserted an echo somewhere in the model method, the behavior stopped. I've been able to circumvent the behavior with an if statement in the model because to 2 secondary iterations were called with a $ca_type_id = 0. Which is strange, because it should be overriding a 0 value with a uri segment in the controller... and the actual uri segment certainly shouldn't have changed. Does this make sense? |