Fat models - skin controllers with File Uploading |
(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. |
Messages In This Thread |
Fat models - skin controllers with File Uploading - by Lykos22 - 12-22-2014, 03:23 AM
RE: Fat models - skin controllers with File Uploading - by InsiteFX - 12-22-2014, 04:37 AM
RE: Fat models - skin controllers with File Uploading - by no1youknowz - 12-22-2014, 08:50 PM
RE: Fat models - skin controllers with File Uploading - by Lykos22 - 12-23-2014, 01:15 AM
RE: Fat models - skin controllers with File Uploading - by Avenirer - 12-23-2014, 04:35 AM
|