lang()

lang($line[, $for = ''[, $attributes = array()]])

Parameters:
  • $line (string) – Language line key
  • $for (string) – HTML “for” attribute (ID of the element we’re creating a label for)
  • $attributes (array) – Any additional HTML attributes
Returns:

The language line; in an HTML label tag, if the $for parameter is not empty

Return type:

string

This function returns a line of text from a loaded language file with simplified syntax that may be more desirable for view files than CI_Lang::line().

Examples:

echo lang('language_key');
// Outputs: Language line

echo lang('language_key', 'form_item_id', array('class' => 'myClass'));
// Outputs: <label for="form_item_id" class="myClass">Language line</label>
doc_CodeIgniter
2016-10-15 16:32:28
Comments
Leave a Comment

Please login to continue.