From ef9ceafdca4cd6bad23701fafed800e30479d9d8 Mon Sep 17 00:00:00 2001 From: Alexander Kochetov Date: Thu, 20 Jun 2013 00:03:22 +0400 Subject: [PATCH] Refactoring --- framework/yii/helpers/base/Html.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/framework/yii/helpers/base/Html.php b/framework/yii/helpers/base/Html.php index bca17e3..043fc42 100644 --- a/framework/yii/helpers/base/Html.php +++ b/framework/yii/helpers/base/Html.php @@ -152,11 +152,8 @@ class Html */ public static function tag($name, $content = '', $options = array()) { - if (isset(static::$voidElements[strtolower($name)])) { - return static::beginTag($name, $options); - } else { - return static::beginTag($name, $options) . $content . static::endTag($name); - } + $html = "<$name" . static::renderTagAttributes($options) . '>'; + return isset(static::$voidElements[strtolower($name)]) ? $html : "$html$content"; } /**