Skip to content

Commit 8a3174d

Browse files
committed
docs: remove <?php in sample code
1 parent 2b530fe commit 8a3174d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

user_guide_src/source/outgoing/view_renderer.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ exactly what you want, you may find times where you want to work with it more di
1616
In that case you can access the View service directly:
1717

1818
.. literalinclude:: view_renderer/001.php
19+
:lines: 2-
1920

2021
Alternately, if you are not using the ``View`` class as your default renderer, you
2122
can instantiate it directly:
2223

2324
.. literalinclude:: view_renderer/002.php
25+
:lines: 2-
2426

2527
.. important:: You should create services only within controllers. If you need
2628
access to the View class from a library, you should set that as a dependency
@@ -67,6 +69,7 @@ The ``setVar()`` and ``setData()`` methods are chainable, allowing you to combin
6769
number of different calls together in a chain:
6870

6971
.. literalinclude:: view_renderer/003.php
72+
:lines: 2-
7073

7174
Escaping Data
7275
=============
@@ -78,6 +81,7 @@ escape the data for. See below for context descriptions.
7881
If you don't want the data to be escaped, you can pass ``null`` or ``'raw'`` as the final parameter to each function:
7982

8083
.. literalinclude:: view_renderer/004.php
84+
:lines: 2-
8185

8286
If you choose not to escape data, or you are passing in an object instance, you can manually escape the data within
8387
the view with the ``esc()`` function. The first parameter is the string to escape. The second parameter is the
@@ -137,6 +141,7 @@ Class Reference
137141
Builds the output based upon a file name and any data that has already been set:
138142

139143
.. literalinclude:: view_renderer/005.php
144+
:lines: 2-
140145

141146
.. php:method:: renderString($view[, $options[, $saveData = false]])
142147
:noindex:
@@ -150,6 +155,7 @@ Class Reference
150155
Builds the output based upon a view fragment and any data that has already been set:
151156

152157
.. literalinclude:: view_renderer/006.php
158+
:lines: 2-
153159

154160
.. warning:: This could be used for displaying content that might have been stored in a database,
155161
but you need to be aware that this is a potential security vulnerability,
@@ -167,6 +173,7 @@ Class Reference
167173
Sets several pieces of view data at once:
168174

169175
.. literalinclude:: view_renderer/007.php
176+
:lines: 2-
170177

171178
Supported escape contexts: ``html``, ``css``, ``js``, ``url``, or ``attr`` or ``raw``.
172179
If ``'raw'``, no escaping will happen.
@@ -186,6 +193,7 @@ Class Reference
186193
Sets a single piece of view data:
187194

188195
.. literalinclude:: view_renderer/008.php
196+
:lines: 2-
189197

190198
Supported escape contexts: ``html``, ``css``, ``js``, ``url``, ``attr`` or ``raw``.
191199
If ``'raw'``, no escaping will happen.

0 commit comments

Comments
 (0)