I think a component would be best. Although, given you have an actual Image model/controller, I also don't think it's too big a deal that you have everything in the controller. But doing this sort of stuff in a component just feels right to me. Also, that should make it easier to re-use the code for another project.
I certainly don't think this should be in the model though (or even a behavior). Maybe a helper would make sense if you were serving up different sizes based on the user's request. On Thu, May 29, 2008 at 5:51 PM, aranworld <[EMAIL PROTECTED]> wrote: > > Time for a semantic question. > > I have a controller for images, which handles the process of uploading > an image to my website. > > Information about the image -- caption, filename, etc. -- is stored in > the database with a model named Image. > > I have some functions which generate various sized versions of the > uploaded image. One creates a square thumbnail version, another > created a user specified sized version. > > Right now those imagesizing functions are in the ImagesController ... > but I'm wondering if this is the best location for them. > > Should these functions be in an component, instead? Or should they be > in the Image model? It seems strange to put them in the model, since > they don't directly have anything to do with the image data, but maybe > they actually belong there? > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
