Example #1
0
// provides current request and http method
// $baseQuery argument defines folder via site is avilable:
// http://fullSite.com/Adress => $baseQuery = /Adress (without slash on end)
// It is possible to define custom request and http method:
// $matcher->match(null, '/customRequest', 'GET');
// Display response
// Display matched params
echo 'Routes:<pre>';
print_r($response->all());
echo '</pre>';
// Get concrete param
echo $response->get('token');
// Get route name
echo 'Route name: ';
echo $response->name();
echo '<br />';
// Get route group
echo 'Route group: ';
echo $response->group();
echo '<br />';
// Get route controller
echo 'Controller: ';
echo $response->controller();
echo '<br />';
// Get attachment
$attachment = $response->attachment();
$attachment();
// Reverse Routing
$url = new UrlGenerator($route, $host);
echo 'Link: ';
echo $url->url('user', ['user' => 'UserName']);