summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/helpers
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-07-19 13:15:49 +0200
committerAndrey Andreev <narf@devilix.net>2016-07-19 13:15:49 +0200
commitfc6f444f74b54a3c7ff3c53ba7fdf83378a86bcc (patch)
tree51e233a28d7a15680e32364c232c2dcd75af971d /user_guide_src/source/helpers
parent79b9923634cdb69f746ffcd4b288f738988b1367 (diff)
[ci skip] Clarify lang() helper docs
As requested in #4693
Diffstat (limited to 'user_guide_src/source/helpers')
-rw-r--r--user_guide_src/source/helpers/language_helper.rst13
1 files changed, 8 insertions, 5 deletions
diff --git a/user_guide_src/source/helpers/language_helper.rst b/user_guide_src/source/helpers/language_helper.rst
index cadf3c0ce..cfbd6c057 100644
--- a/user_guide_src/source/helpers/language_helper.rst
+++ b/user_guide_src/source/helpers/language_helper.rst
@@ -27,17 +27,20 @@ The following functions are available:
.. php:function:: lang($line[, $for = ''[, $attributes = array()]])
- :param string $line: Language line key
- :param string $for: HTML "for" attribute (ID of the element we're creating a label for)
- :param array $attributes: Any additional HTML attributes
- :returns: HTML-formatted language line label
+ :param string $line: Language line key
+ :param string $for: HTML "for" attribute (ID of the element we're creating a label for)
+ :param array $attributes: Any additional HTML attributes
+ :returns: The language line; in an HTML label tag, if the ``$for`` parameter is not empty
:rtype: 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()``.
- Example::
+ 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> \ No newline at end of file