Where to place functions that work with database |
Hi guys,
I'm sure this is a very remedial question, but I'm not quite sure what is best-practice here. I have one model for each table in my database, and I have a controller that does a lot of calculations involving data from many tables. I'd like to create a bunch of functions to make my code cleaner (and hopefully take some of the code out of the controller). I thought to use helper functions, but I wasn't sure how to access database objects in the helper functions; since my "use" statements are in the controller. Thanks, Phil |
Messages In This Thread |
Where to place functions that work with database - by pcasalegno - 05-07-2019, 01:13 PM
RE: Where to place functions that work with database - by donpwinston - 05-07-2019, 05:05 PM
RE: Where to place functions that work with database - by pcasalegno - 05-07-2019, 07:44 PM
RE: Where to place functions that work with database - by php_rocs - 05-07-2019, 07:01 PM
RE: Where to place functions that work with database - by pcasalegno - 05-07-2019, 07:46 PM
RE: Where to place functions that work with database - by MGatner - 05-14-2019, 07:56 AM
|