[TYPO3-mvc] Fluid / Extbase: TranslateViewHelper - how to use arguments array for vsprintf?

Sebastian Kurfürst sebastian at typo3.org
Thu Jan 28 10:54:17 CET 2010


Hey Andreas,

> $this->view->assign('result', $result);
> 
> and in the template:
> <f:translate key="fromlocallang" arguments="{result}" />
So, result is an array here, and you want to put only, lets say the name
inside?

THen just do: <f:translate key="fromlocallang" arguments="{1:
result.name, 2: result.description}" /> in there.

> I'd find it easier, if something like arguments="{result.name},
> {result.name2}" could be used, so in locallang.xml %1$s would give me
> result.name
See above :-)

> In the comments from php.net to vsprintf, an alternative usage with
> associative arrays is shown, so in the locallang.xml something like
> $(name)s could be used.
That would be very cool, but actually as I understand the comments, this
is *not* done by the out-of-the-box vsprintf function. Or am I wrong? :-)

Greets,
Sebastian



More information about the TYPO3-project-typo3v4mvc mailing list