Routing and error handling.
Protected Properties | |
| bool | $dev = false |
| Request | $request |
| Response | $response |
| Session | $session |
Public Methods | |
| __construct () | |
| Initializes the system for routing, error handling, and output. More... | |
| void | delete (string $path, $controller, array $extra=[]) |
Routes DELETE More... | |
| void | get (string $path, $controller, array $extra=[]) |
Routes GET and HEAD More... | |
| Request | getRequest () |
| Response | getResponse () |
| Session | getSession () |
| bool | isDev () |
| $this | log ($code, string $message) |
| void | post (string $path, $controller, array $extra=[]) |
Routes POST More... | |
| void | put (string $path, $controller, array $extra=[]) |
Routes PUT More... | |
| void | route (array $methods, string $path, $controller, array $extra) |
| Invokes a controller if the HTTP method and path match, and exits. More... | |
| $this | setDev (bool $dev) |
Protected Methods | |
| void | route_call_exit (array $path, $controller, array $extra) |
| __construct | ( | ) |
Initializes the system for routing, error handling, and output.
| void delete | ( | string | $path, |
| $controller, | |||
| array | $extra = [] |
||
| ) |
Routes DELETE
| string | $path | |
| string | callable | $controller | |
| array | $extra |
| void get | ( | string | $path, |
| $controller, | |||
| array | $extra = [] |
||
| ) |
Routes GET and HEAD
| string | $path | |
| string | callable | $controller | |
| array | $extra |
|
final |
| $this log | ( | $code, | |
| string | $message | ||
| ) |
| mixed | $code | |
| string | $message |
| void post | ( | string | $path, |
| $controller, | |||
| array | $extra = [] |
||
| ) |
Routes POST
| string | $path | |
| string | callable | $controller | |
| array | $extra |
| void put | ( | string | $path, |
| $controller, | |||
| array | $extra = [] |
||
| ) |
Routes PUT
| string | $path | |
| string | callable | $controller | |
| array | $extra |
| void route | ( | array | $methods, |
| string | $path, | ||
| $controller, | |||
| array | $extra | ||
| ) |
Invokes a controller if the HTTP method and path match, and exits.
Absolute paths must start with /, all other paths are treated as regular expressions.
| string[] | $methods | |
| string | $path | |
| string | callable | $controller | Controller class, or callable. |
| array | $extra |
|
protected |
| string[] | $path | |
| string | callable | $controller | |
| array | $extra |
| $this setDev | ( | bool | $dev | ) |
| bool | $dev |