[TYPO3-ect] SmartyView & lib/div view in general

Thomas Murphy murphy at spreekonzept.de
Tue Feb 20 00:57:32 CET 2007


Hey guys,

I was looking into lib/div yesterday and wrote a smartyView which 
basically works, yet I don't know what would be the best way to 
implement a clean interface between the controller and the view.
The phpView is AFAIK using the getter functions through lib_viewBase to 
directly take what it needs from the model.

I think this is a different view/templating-paradigm then what I'm used 
with smarty, where we have a (cleaner?) cut between controller & view by 
(regularly) only passing static data in form of variables and arrays.
This is what most of the smarty functionality is working on, like 
foreach and stuff.

You CAN use objects in Smarty, but in this case again the biggest con to 
php-templating would again count for a SmartyView: too much power in the 
hand of the template-designer/coder + unsexy syntax.

What I want to do in a clean way is to get the data out of the model, I 
tried e.g. the iterator with "$this->_iterator->getArrayCopy()", but 
that's quite dirty I guess.

I also thought about directly passing the static data to the render 
function, but this would tie the controller to smarty, making it unable 
to use the phpView. There should be a universal interface for that, have 
I overseen it?

Can any of you give me a hint on accessing the data in a cleaner way?


Thanks,
Thomas


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