[TYPO3-ect] MVC and image rendering...

Elmar HInz elmar.hinz at team.MINUS.red.DOT.net
Sun Mar 4 01:22:24 CET 2007


Am Sat, 03 Mar 2007 17:46:14 -0500 schrieb R. van Twisk:

> hey Guys,
> 
> 
> since I am not to the whole MVC thing I have a question.
> 
> It's about image rendering... Now I could render the image in my model,
> where I go over my array anyways....
> 
> But actually it should be done in my view, right?
> 
> If so, does it mean I need to pick up teh array from
> my view again in some function and render images.
> Or is it fine if I render images in my model?
> 
> I am trying to find a efficient solution.... On the other hand teh array 
> is small
> and will stay below 18 images orso..
> 
> 
> Ries

Hi Ries,

there is never the one and only solution. For images one can discuss if
the rendering belongs into the model or the view. It also depends on what
you mean by "rendering".

I assume the data about the image list results from a DB query. That query
belongs into the model. I would load the resulting list of data into a
tx_lib_object as data transporter. In the view I would generate the images
probably by using tx_lib_image (or an inherited class of it). Typically 
you iterate over the transport container with a rewind-valid-next loop.


Regards

Elmar

































More information about the TYPO3-team-extension-coordination mailing list