[TYPO3-core] RFC #15741: Feature: PageRenderer should be able to include locallang-files as JS-InlineLabels
Jigal van Hemert
jigal at xs4all.nl
Sat Sep 18 20:31:28 CEST 2010
Hi,
On 18-9-2010 18:40, Steffen Kamper wrote:
> One comment: instead of (array) $labels i would test if $labels is an array
> if (is_array($labels) and count($labels) { ...
If $labels is an array foreach will happily accept it without littering
the sys log with a warning. If it's an empty array foreach will be
finished very quickly. So, testing the count() is not needed and only
takes time.
In this case t3lib_div::readLLfile() will return either an array (maybe
empty) or FALSE in case of an error. So a check for FALSE would be enough:
if ($labels !== FALSE) {
foreach...
--
Kind regards / met vriendelijke groet,
Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh
More information about the TYPO3-team-core
mailing list