Welcome Guest, Not a member yet? Register   Sign In
Using Preloaded Model Via BaseController in Other Controllers
#7

Personally I would collect what I need from the request in the controller, and pass this to the model as a parameter. This way the model is not dependent on the incoming request and only deal with database requests. It would also make it easier to test your model if you can just pass an array of options.

But like you said, CI doesn’t force anything and let you do what you want, how you want. So it’s up to you. But I advise to stay as close as possible to the MVC pattern.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply


Messages In This Thread
RE: Using Preloaded Model Via BaseController in Other Controllers - by includebeer - 10-12-2021, 03:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB