summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/libraries
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-01-03 11:47:37 +0100
committerAndrey Andreev <narf@devilix.net>2014-01-03 11:47:37 +0100
commit8da2e229362fc59329b3c3d8eea0dfcbf86759bb (patch)
tree1d6219157213b3249f6f7c7f3c96f43cb057bce2 /user_guide_src/source/libraries
parent5363f4647b4fba3a0f7a52230cc33889096651ca (diff)
[ci skip] Update the Parser library docs
Diffstat (limited to 'user_guide_src/source/libraries')
-rw-r--r--user_guide_src/source/libraries/parser.rst49
1 files changed, 35 insertions, 14 deletions
diff --git a/user_guide_src/source/libraries/parser.rst b/user_guide_src/source/libraries/parser.rst
index 0b77ae4b9..5c184be58 100644
--- a/user_guide_src/source/libraries/parser.rst
+++ b/user_guide_src/source/libraries/parser.rst
@@ -46,15 +46,10 @@ in your controller using the $this->load->library function::
Once loaded, the Parser library object will be available using:
$this->parser
-The following functions are available in this library:
+Parsing templates
+=================
-$this->parser->parse()
-======================
-
-This method accepts a template name and data array as input, and it
-generates a parsed version. Example::
-
- $this->load->library('parser');
+You can use the ``parse()`` method to parse (or render) simple templates, like this::
$data = array(
'blog_title' => 'My Blog Title',
@@ -77,12 +72,6 @@ third parameter::
$string = $this->parser->parse('blog_template', $data, TRUE);
-$this->parser->parse_string()
-==============================
-
-This method works exactly like parse(), only accepts a string as the
-first parameter in place of a view file.
-
Variable Pairs
==============
@@ -147,3 +136,35 @@ function::
$this->parser->parse('blog_template', $data);
+***************
+Class Reference
+***************
+
+.. class: CI_Parser
+
+ .. method:: parse($template, $data[, $return = FALSE])
+
+ :param string $template: Path to view file
+ :param array $data: Variable data
+ :param bool $return: Whether to return the parsed template
+ :returns: mixed
+
+ Parses a template from the provided path and variables.
+
+ .. method:: parse_string($template, $data[, $return = FALSE])
+
+ :param string $template: Path to view file
+ :param array $data: Variable data
+ :param bool $return: Whether to return the parsed template
+ :returns: mixed
+
+ This method works exactly like ``parse()``, only it accepts the template as a
+ string instead of loading a view file.
+
+ .. method:: set_delimiters([$l = '{'[, $r = '}']])
+
+ :param string $l: Left delimiter
+ :param string $r: Right delimiter
+ :returns: void
+
+ Sets the delimiters (opening and closing) for a value "tag" in a template. \ No newline at end of file