[TYPO3-core] RFC Feature #16189: Optimize stdWrap usage for TypoScript content element CLEARGIF
Fabrizio Branca
news at _REMOVETHIS_fabrizio-branca.de
Sun Oct 31 22:07:34 CET 2010
Hi,
why are you checking isset($conf['width.'])? To avoid notices? Then you
should also check isset($conf['width']).
And then: nested ternary operators are not very readable. ($wrap = ...)
Another suggestion: If your touching this part anyways I would go for a
refactoring. Long strings concatenated using other strings and variables
are also very unreadable. It's hard to say how the final string will
look like and what are the dynamic part in it. I formed a habit to use
sprintf in those situations:
$theValue = $this->cObj->wrap(
sprintf('<img src="%sclear.gif" width="%s" height="%s" %s alt=""
title="" />',
$GLOBALS['TSFE']->absRefPrefix,
$width,
$height,
$this->cObj->getBorderAttr($wrap)
),
$wrap
);
Minor thing: As the title tag is an optional tag and empty in this case
I would remove it from here...
Besides that: +1 by reading and thanks for putting in all those missing
stdWraps!
Bye,
Fabrizio
More information about the TYPO3-team-core
mailing list