From 35cfbfdef457d7d330c5a3839baea250a563af67 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 22 Nov 2008 21:50:39 +0000 Subject: Pass extra args on to the block function. Avoid excess string concatenation (not benchmarked). --- core/libraries/Theme.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/libraries/Theme.php b/core/libraries/Theme.php index d7790626..569b2d52 100644 --- a/core/libraries/Theme.php +++ b/core/libraries/Theme.php @@ -87,13 +87,15 @@ class Theme_Core { } } - $blocks = ""; + $blocks = array(); if (!empty($this->block_helpers[$function])) { foreach ($this->block_helpers[$function] as $helper_class) { - $blocks .= call_user_func_array(array($helper_class, $function), array($this)) . "\n"; + $blocks[] = call_user_func_array( + array($helper_class, $function), + array_merge(array($this), $args)); } } - return $blocks; + return implode("\n", $blocks); default: throw new Exception("@todo UNKNOWN_THEME_FUNCTION: $function"); -- cgit v1.2.3