Skip to content

Commit c4a2339

Browse files
authored
Merge pull request #5326 from kenjis/fix-docs-view_parser.rst
docs: improve view_parser.rst
2 parents 5508ef4 + 6f1879e commit c4a2339

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

user_guide_src/source/outgoing/view_parser.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ can instantiate it directly::
5555
Then you can use any of the three standard rendering methods that it provides:
5656
**render(viewpath, options, save)**, **setVar(name, value, context)** and
5757
**setData(data, context)**. You will also be able to specify delimiters directly,
58-
through the **setDelimiters(left,right)** method.
58+
through the **setDelimiters(left, right)** method.
5959

6060
Using the ``Parser``, your view templates are processed only by the Parser
6161
itself, and not like a conventional view PHP script. PHP code in such a script
@@ -97,7 +97,7 @@ like this::
9797

9898
View parameters are passed to ``setData()`` as an associative
9999
array of data to be replaced in the template. In the above example, the
100-
template would contain two variables: {blog_title} and {blog_heading}
100+
template would contain two variables: ``{blog_title}`` and ``{blog_heading}``
101101
The first parameter to ``render()`` contains the name of the :doc:`view
102102
file </outgoing/views>`, Where *blog_template* is the name of your view file.
103103

@@ -177,8 +177,8 @@ at the top of the page::
177177
</body>
178178
</html>
179179

180-
In the above code you'll notice a pair of variables: {blog_entries}
181-
data... {/blog_entries}. In a case like this, the entire chunk of data
180+
In the above code you'll notice a pair of variables: ``{blog_entries}``
181+
data... ``{/blog_entries}``. In a case like this, the entire chunk of data
182182
between these pairs would be repeated multiple times, corresponding to
183183
the number of rows in the "blog_entries" element of the parameters array.
184184

@@ -252,7 +252,7 @@ The value for the pseudo-variable ``blog_entry`` is an associative
252252
array. The key/value pairs defined inside it will be exposed inside
253253
the variable pair loop for that variable.
254254

255-
A ``blog_template`` that might work for the above::
255+
A **blog_template.php** that might work for the above::
256256

257257
<h1>{blog_title} - {blog_heading}</h1>
258258
{blog_entry}
@@ -696,7 +696,7 @@ Class Reference
696696

697697
.. php:class:: CodeIgniter\\View\\Parser
698698
699-
.. php:method:: render($view[, $options[, $saveData=false]])
699+
.. php:method:: render($view[, $options[, $saveData = false]])
700700
701701
:param string $view: File name of the view source
702702
:param array $options: Array of options, as key/value pairs
@@ -720,7 +720,7 @@ Class Reference
720720
Any conditional substitutions are performed first, then remaining
721721
substitutions are performed for each data pair.
722722

723-
.. php:method:: renderString($template[, $options[, $saveData=false]])
723+
.. php:method:: renderString($template[, $options[, $saveData = false]])
724724
725725
:param string $template: View source provided as a string
726726
:param array $options: Array of options, as key/value pairs
@@ -734,7 +734,7 @@ Class Reference
734734

735735
Options supported, and behavior, as above.
736736

737-
.. php:method:: setData([$data[, $context=null]])
737+
.. php:method:: setData([$data[, $context = null]])
738738
739739
:param array $data: Array of view data strings, as key/value pairs
740740
:param string $context: The context to use for data escaping.
@@ -743,12 +743,12 @@ Class Reference
743743

744744
Sets several pieces of view data at once::
745745

746-
$renderer->setData(['name'=>'George', 'position'=>'Boss']);
746+
$renderer->setData(['name' => 'George', 'position' => 'Boss']);
747747

748748
Supported escape contexts: html, css, js, url, or attr or raw.
749749
If 'raw', no escaping will happen.
750750

751-
.. php:method:: setVar($name[, $value=null[, $context=null]])
751+
.. php:method:: setVar($name[, $value = null[, $context = null]])
752752
753753
:param string $name: Name of the view data variable
754754
:param mixed $value: The value of this view data

0 commit comments

Comments
 (0)