Cml\Service\FastRoute::addRoute PHP Method

addRoute() private method

添加一个路由
private addRoute ( array | string $method, string $pattern, mixed $action ) : void
$method array | string
$pattern string
$action mixed
return void
    private function addRoute($method, $pattern, $action)
    {
        if (is_array($method)) {
            foreach ($method as $verb) {
                $this->routes[$verb . $pattern] = ['method' => $verb, 'uri' => self::patternFactory($pattern), 'action' => $action];
            }
        } else {
            $this->routes[$method . $pattern] = ['method' => $method, 'uri' => self::patternFactory($pattern), 'action' => $action];
        }
    }