Skip to content

Commit 8bb1c17

Browse files
committed
docs: imporve pseudo-variable names
1 parent e8e5fac commit 8bb1c17

4 files changed

Lines changed: 13 additions & 11 deletions

File tree

user_guide_src/source/outgoing/view_parser.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,21 +200,21 @@ an associative array of values, like a record from a database:
200200

201201
.. literalinclude:: view_parser/008.php
202202

203-
The value for the pseudo-variable ``blog_entry`` is an associative
203+
The value for the pseudo-variable ``blog_entries`` is an associative
204204
array. The key/value pairs defined inside it will be exposed inside
205205
the variable pair loop for that variable.
206206

207207
A **blog_template.php** that might work for the above::
208208

209209
<h1>{blog_title} - {blog_heading}</h1>
210-
{blog_entry}
210+
{blog_entries}
211211
<div>
212212
<h2>{title}</h2>
213213
<p>{body}</p>
214214
</div>
215-
{/blog_entry}
215+
{/blog_entries}
216216

217-
If you would like the other pseudo-variables accessible inside the ``blog_entry``
217+
If you would like the other pseudo-variables accessible inside the ``blog_entries``
218218
scope, then make sure that the ``cascadeData`` option is set to true.
219219

220220
Comments

user_guide_src/source/outgoing/view_parser/008.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
$data = [
44
'blog_title' => 'My Blog Title',
55
'blog_heading' => 'My Blog Heading',
6-
'blog_entry' => [
6+
'blog_entries' => [
77
['title' => 'Title 1'],
88
['body' => 'Body 1'],
99
],

user_guide_src/source/outgoing/view_parser/009.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
$template = '{name} lives in {location}{city} on {planet}{/location}.';
3+
$template = '{name} lives in {locations}{city} on {planet}{/locations}.';
44

55
$data = [
6-
'name' => 'George',
7-
'location' => [
6+
'name' => 'George',
7+
'locations' => [
88
['city' => 'Red City', 'planet' => 'Mars'],
99
],
1010
];

user_guide_src/source/outgoing/view_parser/010.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22

3-
$template = '{location}{name} lives in {city} on {planet}{/location}.';
3+
$template = '{locations}{name} lives in {city} on {planet}{/locations}.';
44

55
$data = [
6-
'name' => 'George',
7-
'location' => ['city' => 'Red City', 'planet' => 'Mars'],
6+
'name' => 'George',
7+
'locations' => [
8+
['city' => 'Red City', 'planet' => 'Mars'],
9+
],
810
];
911

1012
return $parser->setData($data)->renderString($template, ['cascadeData' => false]);

0 commit comments

Comments
 (0)