From db257212945875cfdc3ec0f384f5d2eaf0c2aad9 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 20 Jun 2008 05:56:51 +0000 Subject: Added the ability to automatically output language items as form labels in the Language class. --- user_guide/libraries/language.html | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index eff7d32a5..aa0774327 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -110,6 +110,16 @@ is the language set containing it (ie, english). If the second parameter is mis

Where language_key is the array key corresponding to the line you wish to show.

Note: This function simply returns the line. It does not echo it for you.

+ +

Using language lines as form labels

+ +

If your application requires it, a language line can automatically be output as a <label> by specifying a second parameter, which will become the "for" attribute of the label.

+ + +$this->lang->line('language_key', 'form_item_id');
+// becomes <label for="form_item_id">language_key</label> +
+

Auto-loading Languages

If you find that you need a particular language globally throughout your application, you can tell CodeIgniter to auto-load it during system initialization. This is done by opening the application/config/autoload.php file and adding the language(s) to the autoload array.

 

-- cgit v1.2.3-24-g4f1b