[TYPO3-mvc] TypoScriptViewHelper

Bastian Waidelich bastian at typo3.org
Thu Apr 30 15:29:42 CEST 2009


Jeff Segars wrote:

Hi Jeff,

> I was envisioning something slightly different [...]
> <f:typoscript path="lib.my.header" data="{myObject}" />
> which results in....
> $cObj->start($object->_getProperties());

ah, I see. AFAIK _getProperties is very specific. It only works for 
domain object and is probably not meant to be called from the "outside".
But I really like your idea to be able to pass objects too!

I'm about to rewrite all format view helpers from
<f:xyz value="foo" />
to
<f:xyz>foo</f:xyz>
as Peter suggested a few days ago.

What do you think of the following (from the developers perspective):

<f:cObject typoscriptObjectPath="lib.my.header">my header</f:cObject>
-> renders lib.my.header with a current value of "my header"

<f:cObject typoscriptObjectPath="lib.my.header">{foo: 'my 
header'}</f:cObject>
-> renders lib.my.header with no current value but field foo = "my header"

<f:cObject typoscriptObjectPath="lib.my.header" 
currentValueKey="foo">{foo: 'my header', bar: 'something else'}</f:cObject>
-> renders lib.my.header with a current value of "my header" and fields 
foo & bar


now, if you'd pass in an object like:
<f:cObject typoscriptObjectPath="lib.my.header">{someObject}</f:cObject>

the view helper might turn all accessible properties into an array and 
pass it to the cObject.

Me like this ;)

Bastian


More information about the TYPO3-project-typo3v4mvc mailing list