public function route($name, $path, callable $callback)
    {
        // Modifying path from colon parameters /show/:id to bracket parameters /show/{id}
        $path = preg_replace("|(:(\w+))|", '{$2}', $path);

        // if the route is anonymous
        if (!$name) {
            $name = "N".uniqid();
        }

        $map = $this["router"]->getMap();
        $route = $map->route($name, $path, $callback);

        return $route;
    }
public function route($name, $path, callable $callback)
    {
        // Modifying path from colon parameters /show/:id to bracket parameters /show/{id}
        $path = preg_replace("|(:(\w+))|", '{$2}', $path);

        // if the route is anonymous
        if (!$name) {
            $name = "N".uniqid();
        }

        $map = $this["router"]->getMap();
        $route = $map->route($name, $path, $callback);

        return $route;
    }
public function route ( $ name , $ path , callable $ callback ) { // Modifying path from colon parameters /show/:id to bracket parameters /show/{id} $ path = preg_replace ( "|(:(\w+))|" , '{$2}' , $ path ) ; // if the route is anonymous if ( ! $ name ) { $ name = "N" . uniqid ( ) ; } $ map = $ this [ "router" ] -> getMap ( ) ; $ route = $ map -> route ( $ name , $ path , $ callback ) ; return $ route ; }
Define a route and map a callback function to the path

@param string $name
@param string $path
@param callable $callback

@return Aura\Router\Route
Define a route and map a callback function to the path