Welcome Guest, Not a member yet? Register   Sign In
Fat models - skin controllers with File Uploading
#3

(12-22-2014, 04:37 AM)InsiteFX Wrote: do_upload should be in your controller not your model, models are for business logic like database access of records etc;

I'm not going to comment on the above code, because I use ajax for my uploading.

But I have 6+ different "uploads" within my application.  Do all 6 controllers have the logic to handle the uploading?  Of course not, this would be silly to maintain 6 different code functions.

Instead, I have 1 main upload "library" which each controller interfaces with and returns the data when an upload is successful or not.

Ultimately, it's up to you what you decide to do.  I never saw the logic in having models hold anything except database logic.  Especially when you want to move away from CI.
Reply


Messages In This Thread
RE: Fat models - skin controllers with File Uploading - by no1youknowz - 12-22-2014, 08:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB