Skip to content

Commit b95708e

Browse files
committed
docs: fix View saveData description
The default is true.
1 parent 221d484 commit b95708e

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

user_guide_src/source/outgoing/views.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,20 @@ Now open your view file and change the text to variables that correspond to the
123123

124124
Then load the page at the URL you've been using and you should see the variables replaced.
125125

126-
The data passed in is only available during one call to `view`. If you call the function multiple times
127-
in a single request, you will have to pass the desired data to each view. This keeps any data from "bleeding" into
128-
other views, potentially causing issues. If you would prefer the data to persist, you can pass the `saveData` option
129-
into the `$option` array in the third parameter.
126+
The saveData Option
127+
-------------------
128+
129+
The data passed in is retained for subsequent calls to ``view()``. If you call the function multiple times
130+
in a single request, you will not have to pass the desired data to each ``view()``.
131+
132+
But this might not keep any data from "bleeding" into
133+
other views, potentially causing issues. If you would prefer to clean the data after one call, you can pass the ``saveData`` option
134+
into the ``$option`` array in the third parameter.
130135

131136
.. literalinclude:: views/010.php
132137

133-
Additionally, if you would like the default functionality of the view function to be that it does save the data
134-
between calls, you can set ``$saveData`` to **true** in **app/Config/Views.php**.
138+
Additionally, if you would like the default functionality of the view function to be that it does clear the data
139+
between calls, you can set ``$saveData`` to **false** in **app/Config/Views.php**.
135140

136141
Creating Loops
137142
==============

user_guide_src/source/outgoing/views/010.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
'message' => 'My Message',
77
];
88

9-
return view('blog_view', $data, ['saveData' => true]);
9+
return view('blog_view', $data, ['saveData' => false]);

0 commit comments

Comments
 (0)