bootstrap.php 841 B

123456789101112131415
  1. <?php
  2. // Having an "autoloader" (see https://www.php.net/manual/en/language.oop5.autoload.php) allows us to just
  3. // use classes without having to worry where exactly those PHP files are located. This particular autoloader
  4. // is extremely simple.
  5. require_once __DIR__ . "/autoloader.php";
  6. AutoLoader::registerLoader();
  7. // Since we now have an autoloader, we can just "use" the PageContext class and the autloader will actually
  8. // find and load it. The page context represents all the contextual information that we have in our current
  9. // request and we use it to define our page rendering mechanism. This mechanism is mostly based on some
  10. // very simple conventions for where certain types of files are placed.
  11. $context = new PageContext($_SERVER["REQUEST_URI"]);
  12. // We just call "render" which will do the rest for us.
  13. $context->render();