![]() |
Best place to put callback functions CodeIgniter - Grocery Crud - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10) +--- Thread: Best place to put callback functions CodeIgniter - Grocery Crud (/showthread.php?tid=62393) |
Best place to put callback functions CodeIgniter - Grocery Crud - marlaaragao - 07-09-2015 Hello, I'm new to CodeIgniter and I am in doubt about where is the best place to put the callback functions: Controller or Model? I'm using Grocery Crud to perform some of the crud actions, and it has it's own callback functions as well. Where is the best place to place these? Grocery crud is used on controller. The example bellow shows my doubt: Code: //I can call the model class and place the actual 'callback_after_insert' function there: Which one is the best practice? Thanks a lot! RE: Best place to put callback functions CodeIgniter - Grocery Crud - InsiteFX - 07-09-2015 If your dealing with database stuff then put it in your model. RE: Best place to put callback functions CodeIgniter - Grocery Crud - marlaaragao - 08-06-2015 (07-09-2015, 03:06 PM)InsiteFX Wrote: If your dealing with database stuff then put it in your model. Thank you! |