Bramus\Router\Router::match PHP Method

match() public method

Store a route and a handling function to be executed when accessed using one of the specified methods
public match ( string $methods, string $pattern, object | callable $fn )
$methods string Allowed methods, | delimited
$pattern string A route pattern such as /about/system
$fn object | callable The handling function to be executed
    public function match($methods, $pattern, $fn)
    {
        $pattern = $this->baseRoute . '/' . trim($pattern, '/');
        $pattern = $this->baseRoute ? rtrim($pattern, '/') : $pattern;
        foreach (explode('|', $methods) as $method) {
            $this->afterRoutes[$method][] = array('pattern' => $pattern, 'fn' => $fn);
        }
    }