[TYPO3-core] RFC #16173: Refactor FLUIDTEMPLATE cObject to use the new Fluid standalone view

JoH asenau info at cybercraft.de
Tue Nov 2 10:30:31 CET 2010


> Seems so! That is indeed the most efficient way of doing it:
> 
> + $partialRootPath = isset($conf['partialRootPath.'])
> + ? $this->cObj->stdWrap($conf['partialRootPath'],
> $conf['partialRootPath.'])
> + : $conf['partialRootPath'];
> 
> Will you incorporate this in your refactoring #16173, making #16198
> obsolete? AFAIK Joey wanted to change that from a ternary checking to
> a regular if / else, which would also improve readability.

In this case I wanted to keep the ternary, since its better to read.
Currently my personal rule of thumb regarding readability is:

Two different terms assigned to a variable based on a condition: use a ternary operator.
One term assigned to a variable based on a condition, else do nothing: use if without braces
Two different terms assigned to a variable based on a condition with at least one of them being another conditional check: use if/else

I didn't check the CGL though, so correct me if I'm not allowed to do that ;-)
 
>> Still: only setting stdWrap properties on layout/partialRootPath
>> without explicitly setting the value won't work - do you think,
>> that's a problem? 
> 
> You can set a "value" using stdWrap properties, like my example
> before. Or something like:
> 
>  layoutRootPath.cObject = TEXT
>  layoutRootPath.cObject.value = fileadmin/path/
> 
> The TypoScript developers usually find it very convenient to be able
> to do such strange things, and it would be a shame if we would have
> to set a value just to make it work:

Exactly that's the point :-)

Simple real world examples:
layoutRootPath.field = myRootPathField
layoutRootPath.data = GP:myRootPath

Cheers

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com


More information about the TYPO3-team-core mailing list