Skip to content

Commit 537e896

Browse files
authored
Merge pull request #6260 from kenjis/fix-docs-uploaded_files.rst
docs: fix uploaded_files.rst
2 parents eb83ec8 + 8332b3b commit 537e896

2 files changed

Lines changed: 28 additions & 3 deletions

File tree

user_guide_src/source/libraries/uploaded_files.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ find reference information.
3232
Creating the Upload Form
3333
========================
3434

35-
Using a text editor, create a form called upload_form.php. In it, place
35+
Using a text editor, create a form called **upload_form.php**. In it, place
3636
this code and save it to your **app/Views/** directory:
3737

3838
.. literalinclude:: uploaded_files/001.php
@@ -46,7 +46,7 @@ wrong.
4646
The Success Page
4747
================
4848

49-
Using a text editor, create a form called upload_success.php. In it,
49+
Using a text editor, create a form called **upload_success.php**. In it,
5050
place this code and save it to your **app/Views/** directory::
5151

5252
<!DOCTYPE html>
@@ -72,7 +72,7 @@ place this code and save it to your **app/Views/** directory::
7272
The Controller
7373
==============
7474

75-
Using a text editor, create a controller called Upload.php. In it, place
75+
Using a text editor, create a controller called **Upload.php**. In it, place
7676
this code and save it to your **app/Controllers/** directory:
7777

7878
.. literalinclude:: uploaded_files/002.php
@@ -81,6 +81,13 @@ this code and save it to your **app/Controllers/** directory:
8181
only :ref:`rules-for-file-uploads` can be used to validate upload file with :doc:`validation`.
8282
The rule ``required`` also can't be used, so use ``uploaded`` instead.
8383

84+
The Routes
85+
==========
86+
87+
Using a text editor, open **app/Config/Routes.php**. In it, add the following two routes:
88+
89+
.. literalinclude:: uploaded_files/021.php
90+
8491
The Upload Directory
8592
====================
8693

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
// ...
4+
5+
/*
6+
* --------------------------------------------------------------------
7+
* Route Definitions
8+
* --------------------------------------------------------------------
9+
*/
10+
11+
// We get a performance increase by specifying the default
12+
// route since we don't have to scan directories.
13+
$routes->get('/', 'Home::index');
14+
15+
$routes->get('upload', 'Upload::index'); // Add this line.
16+
$routes->post('upload/upload', 'Upload::upload'); // Add this line.
17+
18+
// ...

0 commit comments

Comments
 (0)