Permalink
Browse files

Language Helper: Add optional class variable to label. In addition, r…

…emove the empty check for ID, instead set to NULL.
  • Loading branch information...
1 parent 3396d53 commit 7a1f3f7cfc64f88068e9f856aca322ba08429dd9 @jcc2010 committed Apr 1, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 system/helpers/language_helper.php
@@ -48,14 +48,18 @@
*/
if ( ! function_exists('lang'))
{
- function lang($line, $id = '')
+ function lang($line, $id = NULL, $class = NULL)
{
$CI =& get_instance();
$line = $CI->lang->line($line);
- if ($id != '')
+ if ( $id && !$class )
{
- $line = '<label for="'.$id.'">'.$line.'</label>';
+ $line = '<label for="'.$id.'">'.$line."</label>";
+ }
+ elseif ( $id && $class )
+ {
+ $line = '<label for="'.$id.'" class="'.$class.'">'.$line."</label>";
}
return $line;

0 comments on commit 7a1f3f7

Please sign in to comment.