Welcome Guest, Not a member yet? Register   Sign In
Where to place functions that work with database
#1

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
Reply


Messages In This Thread
Where to place functions that work with database - by pcasalegno - 05-07-2019, 01:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB