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

Bastian Waidelich bastian at typo3.org
Wed Oct 21 12:07:03 CEST 2009

Martin Kutschker wrote:

Hi Masi,

> |
> * it is shorter

"<?" is shorter than "<?php" too ;)

> * the functionality resembles more shell chaining then function chaining

And you think, shell syntax makes more sense than function syntax in a 
Fluid template?

> * it is used by Smarty for modifiers (but this could be a con for some)

This is absolutely no con for me. After all we're looking for the best 
syntax, not for the most virgin syntax ;)

But take this example:

{post.title | f:format.crop(maxChars: 30) | f:format.nl2br()}

For me, it wouldn't be clear, which view helper is called first - and it 
would make a big difference here.

{post.title -> f:format.crop(maxChars: 30) -> f:format.nl2br()}

the order seems to be more explicit.

> I'm no big fan of a syntax that resembles too close PHP (or other programming languages).
> It might deceive programmers (instead of helping them) and doesn't help those template
> authors who cannot code (and shouldn't be required to do).

As I stated in my reply to Roberts post, I don't share that opinion.
Why will it deceive coders? The HTML template is a different 
environment, I doubt people will mix it up. And even if they do, it 
would still work ;)
And for authors who cannot code, the coder should create custom view 
helpers for the very case - or they need to learn the syntax (and then 
"|" or "->" is no big difference)


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