The first thing that we need to do is create a named constant called ROOT
, which will give us the full location of our working directory. Until now, we haven't had to do any extra including of files, but with our layouts and views, it'll start to get a bit difficult if we don't add some functionality to get the working directory. In order to support this, let's add a simple line of code right at the top of our lib/bones.php
file.
<?php
ini_set('display_errors','On');
error_reporting(E_ERROR | E_PARSE);
define('ROOT', __DIR__ . '/..');
function get($route, $callback) {
...
}