mirror of
https://github.com/dannyvankooten/AltoRouter.git
synced 2025-08-08 09:26:33 +02:00
Removal of strstr usage, for older PHP versions.
This commit is contained in:
@@ -3,13 +3,11 @@
|
|||||||
require 'AltoRouter.php';
|
require 'AltoRouter.php';
|
||||||
|
|
||||||
$router = new AltoRouter();
|
$router = new AltoRouter();
|
||||||
$router->setBasePath('/php-projects/AltoRouter');
|
$router->setBasePath('/AltoRouter');
|
||||||
$router->map('GET|POST','/', 'home#index', 'home');
|
$router->map('GET|POST','/', 'home#index', 'home');
|
||||||
$router->map('GET','/users/', array('c' => 'UserController', 'a' => 'ListAction'));
|
$router->map('GET','/users/', array('c' => 'UserController', 'a' => 'ListAction'));
|
||||||
$router->map('GET','/users/[i:id]', 'users#show', 'users_show');
|
$router->map('GET','/users/[i:id]', 'users#show', 'users_show');
|
||||||
$router->map('POST','/users/[i:id]/[delete|update:action]', 'usersController#doAction', 'users_do');
|
$router->map('POST','/users/[i:id]/[delete|update:action]', 'usersController#doAction', 'users_do');
|
||||||
$router->map('GET','/error/', 'whatever');
|
|
||||||
$router->map('GET','/error/[i:code]/', 'whatever');
|
|
||||||
|
|
||||||
// match current request
|
// match current request
|
||||||
$match = $router->match();
|
$match = $router->match();
|
||||||
|
Reference in New Issue
Block a user