[TYPO3-50-general] RFC: Improved Shorthand Syntax

Robert Lemke robert at typo3.org
Wed Oct 21 10:17:16 CEST 2009


Hi Sebastian,

Am 20.10.2009 um 11:03 schrieb Sebastian Kurfürst:

> There is just one thing I am not really sure about: Should we use ->  
> or
> | for chaining?
>
> I mean, | is known from the command-line, whereas "->" shows that data
> is passed around as well, but in PHP, "->" does something totally
> different (calling an method on an object)...
>
> So, I am still undecided if | or -> is better. Some comments? :-)

Karsten and I just wondered if even "->" is okay for XML – or is it  
only allowed enclosed in CDATA?
Would this be acceptable by an XML Parser?

<f:image title="{post.title->f:format.crop(maxChars: 30)}" />

Someone (Bastian?) noted that the task is somewhat similar to that of  
TS2 processors and, yes, there
the syntax would be something like

post.title << 1.crop(maximum = "30")

I still like it for that purpose but feel like it doesn't fit 100% for  
Fluid templates.

So, what signs could we use?

a) <f:image title="{post.title->f:format.crop(maxChars: 30)`}" />
b) <f:image title="{post.title | f:format.crop(maxChars: 30)}" />
c) <f:image title="{post.title `f:format.crop(maxChars: 30)`}" />
d) <f:image title="{post.title ? f:format.crop(maxChars: 30)}" />
e) <f:image title="{post.title; f:format.crop(maxChars: 30)}" />
f) <f:image title="{post.title < f:format.crop(maxChars: 30)}" />
g) <f:image title="{post.title << f:format.crop(maxChars: 30)}" />
h) <f:image title="{post.title & f:format.crop(maxChars: 30)}" />
i) <f:image title="{post.title ☜ f:format.crop(maxChars: 30)}" />)
j) <f:image title="{post.title ↫ f:format.crop(maxChars: 30)}" />)

Hmm. If I was to decide it right now I'd select in the following order:

g), b), e)

I currently don't like a) very much because it has too much the notion  
of being a method
of the object instead of a processor to the property.

Comments?

robert



More information about the TYPO3-project-5_0-general mailing list