FastRoute Router

For our routing we are going to use a 3rd party package called FastRoute which uses regular expressions to match URI's to routes and their handlers.

You can find FastRoute here: https://github.com/nikic/FastRoute and we will install it using composer.

Notice! In the video, I install version 2 of FastRoute but it now seems that some of the features I use in this tutorial are being deprecated in v2...very strange.

So please use version 1.3 in order to follow along with me.

You can do this by adding it to the require section of your composer.json like so:

"require": {

  "nikic/fastroute": "1.3.*"

}

The just run composer update

OR

You can also do this from the command line. Just run:

composer require nikic/fastroute:1.3.*

Just leave a message in the comments if you have any difficulty and I'll be there for ya! πŸ¦ΈπŸ»β€β™‚οΈ



Complete and Continue  
Discussion

9 comments