Codeigniter Language Helper– This function returns a line of text from a loaded language file with simplified syntax that may be more desirable for view files than calling. $this->load->helper(‘language’); is used to load the helper. The optional second parameter will also output a form label for you. The language helper file contains functions that assist in working with language files. Here in this tutorial, we are going to explain how to use this helper with the example.
Codeigniter language helper example
Now we will see how to load language helper in codeigniter and then use its function-
Load language helper
How to load language helper in codeingniter example:
$this->load->helper('language'); |
Available functions:-
Following functions are available in language helper.
Language line
Syntax of language line function
Syntax of language line function is :-
lang($line[$for = ''[$attributes = array()]]) |
- $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
Parameters:
EXAMPLE
Here is simple example of language line tags.
Language line tags in codeigniter example:-
|
The output of the above example will be something like this –