public function add($route, $callable, $type = 'any')
    {
        // Check if the route ends with a forward slash
        if ($route && substr($route, -1) !== '/') {
            $route .= '/';
        }

        // Add the route
        $this->routes[strtolower($type)][$route] = $callable;
        return $this;
    }
public function add($route, $callable, $type = 'any')
    {
        // Check if the route ends with a forward slash
        if ($route && substr($route, -1) !== '/') {
            $route .= '/';
        }

        // Add the route
        $this->routes[strtolower($type)][$route] = $callable;
        return $this;
    }
public function add ( $ route , $ callable , $ type = 'any' ) { // Check if the route ends with a forward slash if ( $ route && substr ( $ route , - 1 ) !== '/' ) { $ route .= '/' ; } // Add the route $ this -> routes [ strtolower ( $ type ) ] [ $ route ] = $ callable ; return $ this ; }
Adds a route to the router.

@param string $route The route.
@param callable $callable The method to execute when this route gets called.
@param string $type The request type to bind this route to.

@return $this The current object.
Adds a route to the router .