1- News section
2- ###############################################################################
1+ News Section
2+ ############
33
44In the last section, we went over some basic concepts of the framework
55by writing a class that references static pages. We cleaned up the URI by
66adding custom routing rules. Now it's time to introduce dynamic content
77and start using a database.
88
9- Create a database to work with
10- -------------------------------------------------------
9+ Create a Database to Work with
10+ ******************************
1111
1212The CodeIgniter installation assumes that you have set up an appropriate
1313database, as outlined in the :doc: `requirements </intro/requirements >`.
@@ -47,8 +47,8 @@ The seed records might be something like:
4747 (2,'Say it isn\'t so!','say-it-isnt-so','Scientists conclude that some programmers have a sense of humor.'),
4848 (3,'Caffeination, Yes!','caffeination-yes','World\'s largest coffee shop open onsite nested coffee shop for staff only.');
4949
50- Connect to your database
51- -------------------------------------------------------
50+ Connect to Your Database
51+ ************************
5252
5353The local configuration file, ``.env ``, that you created when you installed
5454CodeIgniter, should have the database property settings uncommented and
@@ -63,8 +63,8 @@ your database properly as described :doc:`here <../database/configuration>`.
6363 database.default.password = root
6464 database.default.DBDriver = MySQLi
6565
66- Setting up your model
67- -------------------------------------------------------
66+ Setting up Your Model
67+ *********************
6868
6969Instead of writing database operations right in the controller, queries
7070should be placed in a model, so they can easily be reused later. Models
@@ -106,8 +106,8 @@ that use the Query Builder to run their commands on the current table, and
106106returning an array of results in the format of your choice. In this example,
107107``findAll() `` returns an array of array.
108108
109- Display the news
110- -------------------------------------------------------
109+ Display the News
110+ ****************
111111
112112Now that the queries are written, the model should be tied to the views
113113that are going to display the news items to the user. This could be done
@@ -174,7 +174,7 @@ The only thing left to do is create the corresponding view at
174174.. literalinclude :: news_section/007.php
175175
176176Routing
177- -------------------------------------------------------
177+ *******
178178
179179Because of the wildcard routing rule created earlier, you need an extra
180180route to view the controller that you just made. Modify your routing file
0 commit comments