private function resolveRouteOptions(Route $route, $routeName)
    {
        if (null === $cmsOptions = $route->getOption('_cms')) {
            throw new \InvalidArgumentException(sprintf('Route "%s" does not have "_cms" defaults attributes.', $routeName));
        }

        $path = $route->getPath();

        $dynamic = false;
        if (preg_match_all('~\{([^\}]+)\}~', $path, $matches, PREG_SET_ORDER)) {
            foreach ($matches as $match) {
                // If route parameter does not have a default value
                if (!array_key_exists($match[1], $route->getDefaults())) {
                    $dynamic = true;
                    break;
                }
            }
        }

        return $this->optionsResolver->resolve(array_merge($cmsOptions, [
            'path'    => $path,
            'dynamic' => $dynamic,
        ]));
    }
private function resolveRouteOptions(Route $route, $routeName)
    {
        if (null === $cmsOptions = $route->getOption('_cms')) {
            throw new \InvalidArgumentException(sprintf('Route "%s" does not have "_cms" defaults attributes.', $routeName));
        }

        $path = $route->getPath();

        $dynamic = false;
        if (preg_match_all('~\{([^\}]+)\}~', $path, $matches, PREG_SET_ORDER)) {
            foreach ($matches as $match) {
                // If route parameter does not have a default value
                if (!array_key_exists($match[1], $route->getDefaults())) {
                    $dynamic = true;
                    break;
                }
            }
        }

        return $this->optionsResolver->resolve(array_merge($cmsOptions, [
            'path'    => $path,
            'dynamic' => $dynamic,
        ]));
    }
private function resolveRouteOptions ( Route $ route , $ routeName ) { if ( null === $ cmsOptions = $ route -> getOption ( '_cms' ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Route "%s" does not have "_cms" defaults attributes.' , $ routeName ) ) ; } $ path = $ route -> getPath ( ) ; $ dynamic = false ; if ( preg_match_all ( '~\{([^\}]+)\}~' , $ path , $ matches , PREG_SET_ORDER ) ) { foreach ( $ matches as $ match ) { // If route parameter does not have a default value if ( ! array_key_exists ( $ match [ 1 ] , $ route -> getDefaults ( ) ) ) { $ dynamic = true ; break ; } } } return $ this -> optionsResolver -> resolve ( array_merge ( $ cmsOptions , [ 'path' => $ path , 'dynamic' => $ dynamic , ] ) ) ; }
Resolve route options.

@param Route  $route
@param string $routeName

@return array
@throws \InvalidArgumentException
Resolve route options .