From 7618e4ee1376c166166b4d3e1eab50d7d7e8b17d Mon Sep 17 00:00:00 2001 From: Angel Guevara Date: Tue, 1 Dec 2015 00:18:50 -0600 Subject: [PATCH] changes suggested by review. --- framework/helpers/BaseHtml.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/framework/helpers/BaseHtml.php b/framework/helpers/BaseHtml.php index ae07562..21202ef 100644 --- a/framework/helpers/BaseHtml.php +++ b/framework/helpers/BaseHtml.php @@ -884,7 +884,7 @@ class BaseHtml $name .= '[]'; } - $formatter = ArrayHelper::remove($options, 'item', null); + $formatter = ArrayHelper::remove($options, 'item'); $itemOptions = ArrayHelper::remove($options, 'itemOptions', []); $encode = ArrayHelper::remove($options, 'encode', true); $separator = ArrayHelper::remove($options, 'separator', PHP_EOL); @@ -911,12 +911,11 @@ class BaseHtml // add a hidden field so that if the list box has no option being selected, it still submits a value $name2 = substr($name, -2) === '[]' ? substr($name, 0, -2) : $name; $hidden = static::hiddenInput($name2, $options['unselect']); + unset($options['unselect']); } else { $hidden = ''; } - unset($options['unselect']); - return $hidden . static::tag($tag, implode($separator, $lines), $options); } @@ -954,7 +953,7 @@ class BaseHtml */ public static function radioList($name, $selection = null, $items = [], $options = []) { - $formatter = ArrayHelper::remove($options, 'item', null); + $formatter = ArrayHelper::remove($options, 'item'); $itemOptions = ArrayHelper::remove($options, 'itemOptions', []); $encode = ArrayHelper::remove($options, 'encode', true); $separator = ArrayHelper::remove($options, 'separator', PHP_EOL); @@ -980,12 +979,11 @@ class BaseHtml if (isset($options['unselect'])) { // add a hidden field so that if the list box has no option being selected, it still submits a value $hidden = static::hiddenInput($name, $options['unselect']); + unset($options['unselect']); } else { $hidden = ''; } - unset($options['unselect']); - return $hidden . static::tag($tag, implode($separator, $lines), $options); }