[TYPO3-mvc] fetch element from array based on object.property
Christine Gerpheide
cgerpheide at gmail.com
Fri Oct 29 13:28:11 CEST 2010
2010/4/17 Martin Kutschker <masi-no at spam-typo3.org>
> Bastian Waidelich schrieb:
> > Martin Kutschker wrote:
> >
> >
> >> Does this work?
> >> {list.{temp}}
> >
> >
> > I think, that's what Peter tried first. It does not work ATM I'm afraid..
>
> He tried:
>
> {list.{object.property}}
>
> My code has one dot less :)
>
> Masi
>
>
Hey list,
To reopen this thread... Is what Masi posted actually supposed to work? I am
trying to use it (together with alias) and it is just printing the string
(with the curly brackets) on the page.
<f:alias map="{productuid: product.uid}">
{product.title} ( {numItemsByProduct.{productuid}} )
</f:alias>
just prints on the page:
( {numItemsByProduct.{productuid} )
Printing {productuid} by itself works, and replacing the {productuid} with
the actual number it represents also works. So is this expected to work, or
is my syntax just incorrect?
Also -- I know there's another thread about this too -- I think the
objectaccessor way is a much more intuitive way to solve this in general,
rather than using alias. So then in my case I would write:
{numItemsByProduct.{product.uid}}
So if this is still up for discussion, I would vote for this syntax to be
added rather than keeping the way of using aliases to solve these type of
problems.
Thanks for any insight,
Christine
More information about the TYPO3-project-typo3v4mvc
mailing list