Skip to content
No description or website provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Controllers
Services
.gitignore
LICENSE
README.md
index.php
routes.json

README.md

WEBII-HW02-Routing

Including

Include Autoloader

require_once __DIR__ . '/Services/autoloader.php';

Import class

use web2hw\Router;

Create routes file

The routes file is a json file, where object key is route unique name.

Each route must have path, method and action keys. Homepage route example:

{
  "homepage": {
    "path": "/",
    "method": "GET",
    "action": "web2hw\\DefaultController::index"
  }
}
You can’t perform that action at this time.