Router
`kingston\icarus\Router`
`class Router`
Custom URL router
Properties
Request |
$request |
the Request instance |
Response |
$response |
the Response instance |
array |
$routeMap |
request route map |
Methods
public function get(string $url, $callback) : void
set get method URL and callback function
Parameters
string
$url
array
$callback
return
void
public function post(string $url, $callback) : void
set post method URL and callback function
Parameters
string
$url
array
$callback
return
void
public function getRouteMap($method) : array
return route map
Parameters
string
$method
return
array
public function getCallback() : string|bool
get route callback funtion
Parameters
none
return
string|bool
public function resolve() : mixed
call route callback function
Parameters
none
return
mixed
public function renderView($view, $params = []) : string
render Route full view
Parameters
string
$view
array
$params
return
string
public function renderViewOnly($view, $params = []) : string
render route view content only
Parameters
string
$view
array
$params
return
string