-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb.php
More file actions
27 lines (26 loc) · 900 Bytes
/
web.php
File metadata and controls
27 lines (26 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
/**
* Web router
*
* @var RouterDispatcher $router
*
* FastRoute parameter patterns:
*
* your-slug Add slug as string "/". (Example: /your-slug)
*
* {name:your_slug} Bind your slug to router "/". (Example: /{name:your-slug})
*
* {name} Matches any segment except "/". (Example: /user/{name})
*
* {id:\d+} Matches numeric values only. (Example: /post/{id})
*
* {name:[^/]+} Explicit single path segment. (Example: /profile/{name:[^/]+})
*
* {slug:.+} Matches everything including slashes. (Example: /cat/{slug:.+})
*
* {lang:(en|sv|de)} Restricts parameter to specific values. (Example: /{lang}/docs)
*/
use App\Controllers\HelloWorldController;
use MaplePHP\Core\Router\RouterDispatcher;
$router->get("/", [HelloWorldController::class, "index"]);
$router->get("/hello/{name}", [HelloWorldController::class, "show"]);