[TYPO3-mvc] [TYPO3-50-general] RFC: Improved Shorthand Syntax
Bastian Waidelich
bastian at typo3.org
Tue Oct 27 18:42:45 CET 2009
Bastian Waidelich wrote:
Me again,
> But after thinking about it again, I'd prefer to slightly modify the
> Fluid template parser and allow following syntax:
>
> {'static string' -> f:format.crop(maxChars: 30)}
I'm not so sure about this anymore..
As Sebastian stated correctly: there seems to be no real use case for
this: For format view helpers the use of static strings makes no sense -
except maybe for the date view helper, and even there
{'now' -> f:format.date(format: 'Y')}
is weird and should rather be
{f:format.date(date: 'now', format: 'Y')}
So I recap and suggest to adjust the following four view helpers:
uri.resource:
from
{foo -> f:uri.resource()}
to
{f:uri.resource(path: foo)}
cObject (v4 only):
from
{foo -> f:cObject(typoscriptObjectPath: 'lib.myCustomCObject')}
to
{f:cObject(data: foo, typoscriptObjectPath: 'lib.myCustomCObject')}
format.date:
from
{foo -> f:format.date(format: 'Y')}
to
{f:format.date(date: foo, format: 'Y')}
format.translate:
from
{foo -> f:format.translate(key: 'bar')} // here, {foo} would be the
fallback - not very intuitive
to
{f:format.translate(default: foo, key: 'bar')}
comments?
Bastian
More information about the TYPO3-project-typo3v4mvc
mailing list