summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/helpers
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-11-26 22:55:37 +0100
committerAndrey Andreev <narf@bofh.bg>2012-11-26 22:55:37 +0100
commit3b407060439258c7ef9f30ac35b5f9f34101fd69 (patch)
tree32649e20306d390cf19fdef1ace7c8e1da75bda1 /user_guide_src/source/helpers
parentb11b9f38f3ae0f9699612ac61000ee789665f2d6 (diff)
Language helper lang() to accept optional HTML attributes
(an improved version of PR #1235)
Diffstat (limited to 'user_guide_src/source/helpers')
-rw-r--r--user_guide_src/source/helpers/language_helper.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/user_guide_src/source/helpers/language_helper.rst b/user_guide_src/source/helpers/language_helper.rst
index 8b039374d..1911e3bfd 100644
--- a/user_guide_src/source/helpers/language_helper.rst
+++ b/user_guide_src/source/helpers/language_helper.rst
@@ -19,18 +19,18 @@ The following functions are available:
lang()
======
-.. php:function:: lang($line, $id = '')
+.. php:function:: lang($line, $for = '', $attributes = array())
:param string $line: Language line key
- :param string $id: ID of the element we're creating a label for
+ :param string $for: HTML "for" attribute (ID of the element we're creating a label for)
+ :param array $attributes: Any additional HTML attributes
:returns: 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()``.
-The optional second parameter will also output a form label for you.
Example::
- echo lang('language_key', 'form_item_id');
- // becomes <label for="form_item_id">language_key</label> \ No newline at end of file
+ echo lang('language_key', 'form_item_id', array('class' => 'myClass');
+ // Outputs: <label for="form_item_id" class="myClass">Language line</label> \ No newline at end of file