Let's create a get
function at the top of the lib/bones.php
file, right after the<?php
tag and before we define the Bones
class:
/Library/Webserver/Documents/verge/lib/bones.php
<?php
ini_set('display_errors','On');
error_reporting(E_ERROR | E_PARSE);
function get($route, $callback) {
Bones::register($route, $callback);
}
class Bones {
...
}
This function lies in the lib/bones.php
file and is called for each get
route that you have defined in your index.php
file. This function is a simple pass-through function that hands off the route and callback to the register
function of Bones
.
Are we on the same page?
We did a whole lot in this section. Let's double check that your code matches my code:
/Library/Webserver/Documents/verge/lib/bones.php
<?php function get($route, $callback) { Bones::register($route, $callback); } class Bones { private static $instance; public static $route_found = false; public...