diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-11-26 22:55:37 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-11-26 22:55:37 +0100 |
commit | 3b407060439258c7ef9f30ac35b5f9f34101fd69 (patch) | |
tree | 32649e20306d390cf19fdef1ace7c8e1da75bda1 /system/helpers/language_helper.php | |
parent | b11b9f38f3ae0f9699612ac61000ee789665f2d6 (diff) |
Language helper lang() to accept optional HTML attributes
(an improved version of PR #1235)
Diffstat (limited to 'system/helpers/language_helper.php')
-rw-r--r-- | system/helpers/language_helper.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/system/helpers/language_helper.php b/system/helpers/language_helper.php index 658be6de7..f931208e1 100644 --- a/system/helpers/language_helper.php +++ b/system/helpers/language_helper.php @@ -45,18 +45,19 @@ if ( ! function_exists('lang')) * * Fetches a language variable and optionally outputs a form label * - * @param string the language line - * @param string the id of the form element + * @param string $line The language line + * @param string $for The "for" value (id of the form element) + * @param array $attributes Any additional HTML attributes * @return string */ - function lang($line, $id = '') + function lang($line, $for = '', $attributes = array()) { $CI =& get_instance(); $line = $CI->lang->line($line); if ($id !== '') { - $line = '<label for="'.$id.'">'.$line.'</label>'; + $line = '<label for="'.$id.'"'._stringify_attributes($attributes).'>'.$line.'</label>'; } return $line; |