summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2008-06-20 07:56:51 +0200
committerDerek Allard <derek.allard@ellislab.com>2008-06-20 07:56:51 +0200
commitdb257212945875cfdc3ec0f384f5d2eaf0c2aad9 (patch)
tree43e2ee6b052b56fa47a1932454c8d6924d33c1ab /system
parentd3ee04109528470666c016fcc05c69941de879b2 (diff)
Added the ability to automatically output language items as form labels in the Language class.
Diffstat (limited to 'system')
-rw-r--r--system/libraries/Language.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/system/libraries/Language.php b/system/libraries/Language.php
index f97db3506..a1f73d03b 100644
--- a/system/libraries/Language.php
+++ b/system/libraries/Language.php
@@ -108,12 +108,20 @@ class CI_Language {
* Fetch a single line of text from the language array
*
* @access public
- * @param string the language line
+ * @param string $line the language line
+ * @param string $label optional label
* @return string
*/
- function line($line = '')
+ function line($line = '', $label = '')
{
- return ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line];
+ $line = ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line];
+
+ if ($label != '')
+ {
+ $line = '<label for="'.$label.'">'.$line."</label>";
+ }
+
+ return $line;
}
}