Skip to content

Commit 48b4aef

Browse files
authored
Merge pull request #6834 from kenjis/fix-docs-tutorial
docs: improve Tutorial
2 parents b549c44 + 0cf9037 commit 48b4aef

4 files changed

Lines changed: 28 additions & 5 deletions

File tree

‎user_guide_src/source/tutorial/create_news_items.rst‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Create News Items
22
#################
33

4+
.. contents::
5+
:local:
6+
:depth: 2
7+
48
You now know how you can read data from a database using CodeIgniter, but
59
you haven't written any information to the database yet. In this section,
610
you'll expand your news controller and model created earlier to include
@@ -18,8 +22,8 @@ Open the **app/Config/Filters.php** file and update the ``$methods`` property li
1822
It configures the CSRF filter to be enabled for all **POST** requests.
1923
You can read more about the CSRF protection in :doc:`Security </libraries/security>` library.
2024

21-
.. Warning:: In general, if you use ``$methods`` filters, you should :ref:`disable auto-routing <use-defined-routes-only>`
22-
because auto-routing permits any HTTP method to access a controller.
25+
.. Warning:: In general, if you use ``$methods`` filters, you should :ref:`disable Auto Routing (Legacy) <use-defined-routes-only>`
26+
because :ref:`auto-routing` permits any HTTP method to access a controller.
2327
Accessing the controller with a method you don't expect could bypass the filter.
2428

2529
Create a Form

‎user_guide_src/source/tutorial/index.rst‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
Build Your First Application
33
############################
44

5+
.. contents::
6+
:local:
7+
:depth: 2
8+
59
Overview
610
********
711

@@ -110,13 +114,20 @@ This means that your application works and you can start making changes to it.
110114
Debugging
111115
*********
112116

113-
Now that you're in development mode, you'll see a toolbar on the bottom of your application.
117+
Debug Toolbar
118+
=============
119+
120+
Now that you're in development mode, you'll see the CodeIgniter flame on the right bottom of your application. Click it and you'll see the debug toolbar.
121+
114122
This toolbar contains a number of helpful items that you can reference during development.
115123
This will never show in production environments. Clicking any of the tabs along the bottom
116124
brings up additional information. Clicking the X on the right of the toolbar minimizes it
117125
to a small square with the CodeIgniter flame on it. If you click that the toolbar
118126
will show again.
119127

128+
Error Pages
129+
===========
130+
120131
In addition to this, CodeIgniter has some helpful error pages when you hit exceptions or
121132
other errors in your program. Open up ``app/Controllers/Home.php`` and change some line
122133
to generate an error (removing a semi-colon or brace should do the trick!). You will be

‎user_guide_src/source/tutorial/news_section.rst‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
News Section
22
############
33

4+
.. contents::
5+
:local:
6+
:depth: 2
7+
48
In the last section, we went over some basic concepts of the framework
59
by writing a class that references static pages. We cleaned up the URI by
610
adding custom routing rules. Now it's time to introduce dynamic content
@@ -15,7 +19,7 @@ In this tutorial, we provide SQL code for a MySQL database, and
1519
we also assume that you have a suitable client for issuing database
1620
commands (mysql, MySQL Workbench, or phpMyAdmin).
1721

18-
You need to create a database that can be used for this tutorial,
22+
You need to create a database ``ci4tutorial`` that can be used for this tutorial,
1923
and then configure CodeIgniter to use it.
2024

2125
Using your database client, connect to your database and run the SQL command below (MySQL)::
@@ -80,7 +84,7 @@ library. This will make the database class available through the
8084
Now that the database and a model have been set up, you'll need a method
8185
to get all of our posts from our database. To do this, the database
8286
abstraction layer that is included with CodeIgniter -
83-
:doc:`Query Builder <../database/query_builder>` - is used in the ``CodeIgnite\Model``. This makes it
87+
:doc:`Query Builder <../database/query_builder>` - is used in the ``CodeIgniter\Model``. This makes it
8488
possible to write your 'queries' once and make them work on :doc:`all
8589
supported database systems <../intro/requirements>`. The Model class
8690
also allows you to easily work with the Query Builder and provides

‎user_guide_src/source/tutorial/static_pages.rst‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Static Pages
22
############
33

4+
.. contents::
5+
:local:
6+
:depth: 2
7+
48
.. note:: This tutorial assumes you've downloaded CodeIgniter and
59
:doc:`installed the framework <../installation/index>` in your
610
development environment.

0 commit comments

Comments
 (0)