[TYPO3-dev] [TYPO3-core] New TYPO3 Coding Guidelines

Christopher Torgalson bedlamhotel at gmail.com
Thu Jul 9 23:25:34 CEST 2009


Hi,

On Thu, Jul 9, 2009 at 1:29 PM, Vladimir
Podkovanov<admin at sitesfactory.ru> wrote:
>> Sure, it is right if many editors does not hightlight vars in string.
>> However in Zend Studio IMHO more readable when var inside string as I
>> can see all SQL request and don't try to concat parts in my mind in
>> order to see whole request ;)
>>
>
> Example:
>
> "where login = '$login'"
> vs
> 'where login = \'' . $login . '\''


If you want to do that, you could also use sprintf--it makes for nice
and readable code up to a point (after 7 or 8 replacements, it's can
be pretty hard to read...):

$format = 'SELECT %s FROM %s WHERE %s LIMIT %d';
$query = sprintf($format, $tables, $from, $where, $limit);

-- 
Christopher Torgalson
http://www.typo3apprentice.com/




More information about the TYPO3-dev mailing list