src/Leevel/Router/Match/PathInfo.php
protected function matcheRestful(array $path): array
    {
        $restfulPath = implode('/', $path);
        $regex = '/^(\S+)\/('.IRouter::RESTFUL_REGEX.')(\/*\S*)$/';

        if (preg_match($regex, $restfulPath, $matches)) {
            $result[IRouter::CONTROLLER] = $matches[1];
            $result[IRouter::PARAMS][IRouter::RESTFUL_ID] = $matches[2];

            if ('' !== $matches[3]) {
                $result[IRouter::ACTION] = substr($matches[3], 1);
            }

            return $result;
        }

        return [];
    }
protected function matcheRestful(array $path): array
    {
        $restfulPath = implode('/', $path);
        $regex = '/^(\S+)\/('.IRouter::RESTFUL_REGEX.')(\/*\S*)$/';

        if (preg_match($regex, $restfulPath, $matches)) {
            $result[IRouter::CONTROLLER] = $matches[1];
            $result[IRouter::PARAMS][IRouter::RESTFUL_ID] = $matches[2];

            if ('' !== $matches[3]) {
                $result[IRouter::ACTION] = substr($matches[3], 1);
            }

            return $result;
        }

        return [];
    }
匹配路由 Restful.

@param array $path

@return array