[TYPO3-mvc] TypoScriptViewHelper
Jeff Segars
jsegars at alumni.rice.edu
Mon May 4 21:55:45 CEST 2009
Bastian Waidelich wrote:
> 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".
Yep, thanks for the reminder. If the underscore in the name wasn't
indication enough, then I should have noticed the internal annotion.
"public" looked so good though :)
>
> 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"
Seems very intuitive to me.
> <f:cObject typoscriptObjectPath="lib.my.header">{foo: 'my
> header'}</f:cObject>
> -> renders lib.my.header with no current value but field foo = "my header"
My only complaint here would be that people may be confused as to
whether they're filling "current" or the data array. To me, its most
natural to use "current" as a value within the tags and the data array
as an attribute.
Either way is fine, I'm just thinking about developer usability issues
when data entered in the same location can be used for several different
things.
> <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 ;)
...and me too :)
Thanks!
Jeff
More information about the TYPO3-project-typo3v4mvc
mailing list