Our framework is technically all ready for us to start building on top. However, we don't have enough support to match and handle complex routes. Since most applications will need this, let's quickly add it.
For example, in the
index.php file, we'll want to be able to define a route for a user profile. This route might be
/user/:username. In this case,
:username will be a variable that we can then access. So, if you went to the URL
/user/tim, you could access the username
tim by using
Bones to grab that section of the URL, and return its value.
Let's start by adding another variable and another call in our
__construct function to our
public $content = ''; public $vars ...