File tree Expand file tree Collapse file tree
user_guide_src/source/outgoing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,15 +123,20 @@ Now open your view file and change the text to variables that correspond to the
123123
124124Then 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
136141Creating Loops
137142==============
Original file line number Diff line number Diff line change 66 'message ' => 'My Message ' ,
77];
88
9- return view ('blog_view ' , $ data , ['saveData ' => true ]);
9+ return view ('blog_view ' , $ data , ['saveData ' => false ]);
You can’t perform that action at this time.
0 commit comments