Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abgeo/webii-hw02-routing


https://github.com/abgeo/webii-hw02-routing

hw request response routing web2

Last synced: 3 days ago
JSON representation

Awesome Lists containing this project

README

        

# WEBII-HW02-Routing
## Including

Include Autoloader
```php
require_once __DIR__ . '/Services/autoloader.php';
```

Import class
```php
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:
```json
{
"homepage": {
"path": "/",
"method": "GET",
"action": "web2hw\\DefaultController::index"
}
}
```