summaryrefslogtreecommitdiffstats
path: root/system/helpers/language_helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/helpers/language_helper.php')
-rw-r--r--system/helpers/language_helper.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/system/helpers/language_helper.php b/system/helpers/language_helper.php
index bd567ed79..6d24a9ca6 100644
--- a/system/helpers/language_helper.php
+++ b/system/helpers/language_helper.php
@@ -1,4 +1,4 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php
/**
* CodeIgniter
*
@@ -24,6 +24,7 @@
* @since Version 1.0
* @filesource
*/
+defined('BASEPATH') OR exit('No direct script access allowed');
/**
* CodeIgniter Language Helpers
@@ -44,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 !== '')
+ if ($for !== '')
{
- $line = '<label for="'.$id.'">'.$line.'</label>';
+ $line = '<label for="'.$for.'"'._stringify_attributes($attributes).'>'.$line.'</label>';
}
return $line;