[TYPO3-50-general] RFC: Improved Shorthand Syntax
Steffen Müller
typo3 at t3node.com
Tue Oct 20 12:02:36 CEST 2009
Hi,
On 20.10.2009 11:21 Bastian Waidelich wrote:
> Sebastian Kurfürst wrote:
>
>
>> There is just one thing I am not really sure about: Should we use -> or
>> | for chaining?
>
> (...)
>> in PHP, "->" does something totally
>> different (calling an method on an object)...
>
yes, but -> can be used to chain PHP methods when the object is returned:
$person->setFirstname('Homer')->setLastname('Simpson');
function setFirstname($firstname) {
$this->firstname = $firstname;
return $this;
}
So +1 for -> instead of |
What about object properties which end with a - ? This should be
strictly forbidden then.
> so what about:
>
> {post.title << f:format.crop(maxChars: 30) << f:format.nl2br()}
>
Please don't, since right to left looks confusing.
--
cheers,
Steffen
TYPO3 Blog: http://www.t3node.com/
Blubber on Twitter: http://twitter.com/t3node
More information about the TYPO3-project-5_0-general
mailing list