diff options
author | dchill42 <dchill42@gmail.com> | 2012-07-31 15:41:01 +0200 |
---|---|---|
committer | dchill42 <dchill42@gmail.com> | 2012-07-31 15:41:01 +0200 |
commit | 7e92b7332ea4d28648e69eabcb93cead35dbca26 (patch) | |
tree | b7714536b89557129ed51fe675725fe28639c1e0 /system/helpers/html_helper.php | |
parent | 57486009573a86d9e286a49c92216ba17aae0d5a (diff) | |
parent | 3a2d573a96241c01124d15c1ce517078e07c6235 (diff) |
Merge branch 'develop' of github.com:/EllisLab/CodeIgniter into session
Diffstat (limited to 'system/helpers/html_helper.php')
-rw-r--r-- | system/helpers/html_helper.php | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index 6fabf9c05..9843e804e 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -51,7 +51,7 @@ if ( ! function_exists('heading')) */ function heading($data = '', $h = '1', $attributes = '') { - return '<h'.$h.($attributes !== '' ? ' ' : '').$attributes.'>'.$data.'</h'.$h.'>'; + return '<h'.$h._stringify_attributes($attributes).'>'.$data.'</h'.$h.'>'; } } @@ -119,23 +119,8 @@ if ( ! function_exists('_list')) // Set the indentation based on the depth $out = str_repeat(' ', $depth); - // Were any attributes submitted? If so generate a string - if (is_array($attributes)) - { - $atts = ''; - foreach ($attributes as $key => $val) - { - $atts .= ' '.$key.'="'.$val.'"'; - } - $attributes = $atts; - } - elseif (is_string($attributes) && strlen($attributes) > 0) - { - $attributes = ' '.$attributes; - } - // Write the opening list tag - $out .= '<'.$type.$attributes.">\n"; + $out .= '<'.$type._stringify_attributes($attributes).">\n"; // Cycle through the list elements. If an array is // encountered we will recursively call _list() @@ -191,9 +176,10 @@ if ( ! function_exists('img')) * * @param mixed * @param bool + * @param mixed * @return string */ - function img($src = '', $index_page = FALSE) + function img($src = '', $index_page = FALSE, $attributes = '') { if ( ! is_array($src) ) { @@ -229,7 +215,7 @@ if ( ! function_exists('img')) } } - return $img.'/>'; + return $img._stringify_attributes($attributes).'/>'; } } |