In this section, we will learn about the configuration
class, and we will also be setting up routing.
We will be setting up the config
class. This will be located in the root of the app
folder. The config
class stores the default controller, the default
method to be loaded, and the database credentials. In the index
file at the beginning, you will be passing the config
class to the route
class. The route
class controls what is to be loaded and when. The focus for now is the configuration
class and routing. The other components will be looked at in more detail in later sections.
The configuration
class is an array of options for the framework including the following:
Database source credentials
Paths to default controllers
Paths to default methods
In this section, we will also create a view class which is responsible for loading views, which enables a place for the presentation layer to be displayed.
When setting up routing, we are informing the...