Class Router
This file manages the routing for incoming URLs. Returns a call (Controller->action()) for the specific route.
To use in conjunction with /src/config/routing.ini, where all the desired routes must be present.
Namespace: Kernel
Package: Kernel
Example:
Usage:
Located at Router.php
Package: Kernel
Example:
[RoutingKey] path = <desired_path> ; no leading slash action = <Controller_Name>::<Action_Name> ; don't write "Controller", just its name after_login = 1 ; (or 0. OPTIONAL and 0 by default.<br/> This means: if on first attempt it has no permission, can the user be auto-redirected after login?) method = "PUT|POST" ; (GET|PUT|POST|DELETE) OPTIONAL, "|" separated if multiple. Will only enter if $_SERVER['REQUEST_METHOD'] matches condition = '$_SERVER["HTTP_HOST"] == "localhost"' ; OPTIONAL. If set, the code will be evaluated (function: eval()) as a further filter
Usage:
The [keys] MUST be unique throughout ALL routing.ini files.
The action omits the "Controller" part of the controller name.
Login::showLogin calls LoginController->showLogin(), \Core\Login::showLogin calls
\Core\LoginController->showLogin() and ::test calls Controller->test()
Located at Router.php
public static
array
|