add("/admin/{controller}/{action}", ["namespace" => "Admin"]); $router->add("/product/{slug:[\w-]+}", ["controller" => "products", "action" => "show"]); $router->add("/{title}/{id:\d+}/{page:\d+}", ["controller" => "products", "action" => "showPage"]); $router->add("/{controller}/{id:\d+}/{action}"); $router->add("/home/index", ["controller" => "home", "action" => "index"]); $router->add("/products", ["controller" => "products", "action" => "index"]); $router->add("/", ["controller" => "home", "action" => "index"]); $router->add("/{controller}/{action}"); $dispatcher = new Framework\Dispatcher($router); $dispatcher->handle($path);