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

Steve Ryan stever at syntithenai.com
Sun Mar 4 02:29:34 CET 2007


Hi Ries,
   I'd suggest that converting the image filename(s) stored in the model 
into an image tag (possibly pointing at a thumbnailed image) would be 
view functionality. Possibly just the template or anything reusable 
toward generating the thumbnail link back in the view class.

Can't see the efficiency problem, the image data in the model is small.
Even if the images were binary blobs and there were lots of them, you 
still only have the one copy of the data stored in the model being 
accessed from the view template. Object(and array?) assignments are by 
reference in php.

$modelClassName =tx_div::makeInstanceClassName('tx_apples_models_example');
$model=new $modelClassName();
$modelCopy=$model;
$modelCopy->set('help','me');
return $model->get('help');

gives 'me'


cheers
Steve Ryan

R. van Twisk wrote:
> 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
> 


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