Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor: rename props class and add small examples to router comment
  • Loading branch information
wazabii8 committed Mar 10, 2026
commit aada22ffe3af15391e4c8cbee6138b0eff86f67e
2 changes: 1 addition & 1 deletion configs/ConfigProps.php → configs/CliOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* - Null values allow the system to distinguish between "not provided" and "intentionally set".
* - Do not use array values or multiple data types
*/
class ConfigProps extends AbstractConfigProps
class CliOptions extends AbstractConfigProps
{
public ?string $timezone = null;
public ?string $locale = null;
Expand Down
14 changes: 13 additions & 1 deletion routers/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@
* Web router
*
* @var RouterDispatcher $router
*
* FastRoute parameter patterns:
*
* {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\StartController;
use MaplePHP\Core\Router\RouterDispatcher;

$router->get("/", [StartController::class, "index"]);
$router->get("/{page:.+}", [StartController::class, "show"]);
$router->get("/{page}", [StartController::class, "show"]);