PHP Classes

File: index.php

Recommend this page to a friend!
  Packages of Vitalij Mik   Attributes   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Attributes
Route requests based on the current URL and method
Author: By
Last change:
Date: 8 months ago
Size: 552 bytes
 

Contents

Class file image Download
<?php
error_reporting
(E_ALL);

require_once
__DIR__ . '/Router.php';
require_once
__DIR__ . '/Request.php';
require_once
__DIR__ . '/RouteNotFoundException.php';
require_once
__DIR__ . '/IndexController.php';
require_once
__DIR__ . '/ProfileController.php';
require_once
__DIR__.'/Route.php';

$container = require_once __DIR__.'/diContainer.php';

$router = $container[Router::class]();

$request = Request::createFromGlobal();

try{
    echo
$router->handle($request);
}catch (
RouteNotFoundException $exception){
    echo
$exception->getMessage();
}