Creating a Simple PHP Router

Created on December 28, 2018

This video course will teach you the basics on creating a simple PHP router. Let's learn how to create a simple routing system with PHP. 


You can find the source code for this video course at https://github.com/thedevdojo/create-a-php-routing-system. You can find a breakdown of each episode below:

Creating the Index File - In the first video we will be creating our index file which is the main entry point for our router.

Mapping a Route to a File - In this video we’ll be showing you how you can map a route to a specific file.

Passing Arguments - In this video we will show you how you can make the route parameters pass arguments to a specific file or function.

Creating Our Route Class - In this video we will be separating our logic into a single Router class that we will then use to create our routes.

Mapping Routes in our Class - In this final video we will be showing you how to map a route to a specific file inside of our Router Class.


Thanks for watching! This was just a simple implementation on how to creating a PHP routing system. There are many more things that you will want to implement in this routing system. You will also want to create a 404 page when the route that someone is trying to access is not found. But in this series I just wanted to get you started and show you how to create a simple PHP Routing System :)

Comments (0)

Creating the Index File

5 videos (12 minutes)

Autoplay?

0% completed
Now Playing 1. Creating the Index File
2. Mapping a Route to a File
3. Passing Arguments
4. Creating our Route Class
5. Mapping Routes in our Class