Skip to content

Commit cb64680

Browse files
committed
docs: replace blogview with blog_view
We use snake_case view filename, e.g. welcome_message, error_404.
1 parent 05ce8a5 commit cb64680

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

user_guide_src/source/outgoing/views.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Using the example controller you created in the controller page, let’s add a v
1919
Creating a View
2020
===============
2121

22-
Using your text editor, create a file called ``blogview.php`` and put this in it::
22+
Using your text editor, create a file called ``blog_view.php`` and put this in it::
2323

2424
<html>
2525
<head>
@@ -53,7 +53,7 @@ Now, open the controller file you made earlier called ``Blog.php``, and replace
5353
{
5454
public function index()
5555
{
56-
echo view('blogview');
56+
echo view('blog_view');
5757
}
5858
}
5959

@@ -109,9 +109,9 @@ to package your views together in a module-like fashion for easy re-use or distr
109109

110110
If you have ``Blog`` directory that has a PSR-4 mapping set up in the :doc:`Autoloader </concepts/autoloader>` living
111111
under the namespace ``Example\Blog``, you could retrieve view files as if they were namespaced also. Following this
112-
example, you could load the **blogview.php** file from **Blog/Views** by prepending the namespace to the view name::
112+
example, you could load the **blog_view.php** file from **Blog/Views** by prepending the namespace to the view name::
113113

114-
echo view('Example\Blog\Views\blogview');
114+
echo view('Example\Blog\Views\blog_view');
115115

116116
Caching Views
117117
=============
@@ -140,7 +140,7 @@ Here's an example::
140140
'message' => 'My Message',
141141
];
142142

143-
echo view('blogview', $data);
143+
echo view('blog_view', $data);
144144

145145
Let's try it with your controller file. Open it and add this code::
146146

@@ -155,7 +155,7 @@ Let's try it with your controller file. Open it and add this code::
155155
$data['title'] = "My Real Title";
156156
$data['heading'] = "My Real Heading";
157157

158-
echo view('blogview', $data);
158+
echo view('blog_view', $data);
159159
}
160160
}
161161

@@ -184,7 +184,7 @@ into the `$option` array in the third parameter.
184184
'message' => 'My Message',
185185
];
186186

187-
echo view('blogview', $data, ['saveData' => true]);
187+
echo view('blog_view', $data, ['saveData' => true]);
188188

189189
Additionally, if you would like the default functionality of the view function to be that it does save the data
190190
between calls, you can set ``$saveData`` to **true** in **app/Config/Views.php**.
@@ -212,7 +212,7 @@ Here’s a simple example. Add this to your controller::
212212
'heading' => 'My Real Heading',
213213
];
214214

215-
echo view('blogview', $data);
215+
echo view('blog_view', $data);
216216
}
217217
}
218218

0 commit comments

Comments
 (0)