public function getDataByUriTemplate($uriTemplate, $option = null)
    {
        if (isset($this->map[$uriTemplate])) {
            $target = $this->map[$uriTemplate];

            if ($option !== null) {
                // The option might not be set, so ensure
                if (!isset($target[$option])) {
                    throw new RuntimeException(sprintf('Can not read non-existing option %s for "%s"', $option, $uriTemplate));
                } else {
                    return $target[$option];
                }

            } else {
                return $target;
            }

        } else {
            throw new RuntimeException(sprintf(
                'URI "%s" does not belong to route map. Cannot get a controller in %s', $uriTemplate, __METHOD__
            ));
        }
    }
public function getDataByUriTemplate($uriTemplate, $option = null)
    {
        if (isset($this->map[$uriTemplate])) {
            $target = $this->map[$uriTemplate];

            if ($option !== null) {
                // The option might not be set, so ensure
                if (!isset($target[$option])) {
                    throw new RuntimeException(sprintf('Can not read non-existing option %s for "%s"', $option, $uriTemplate));
                } else {
                    return $target[$option];
                }

            } else {
                return $target;
            }

        } else {
            throw new RuntimeException(sprintf(
                'URI "%s" does not belong to route map. Cannot get a controller in %s', $uriTemplate, __METHOD__
            ));
        }
    }
public function getDataByUriTemplate ( $ uriTemplate , $ option = null ) { if ( isset ( $ this -> map [ $ uriTemplate ] ) ) { $ target = $ this -> map [ $ uriTemplate ] ; if ( $ option !== null ) { // The option might not be set, so ensure if ( ! isset ( $ target [ $ option ] ) ) { throw new RuntimeException ( sprintf ( 'Can not read non-existing option %s for "%s"' , $ option , $ uriTemplate ) ) ; } else { return $ target [ $ option ] ; } } else { return $ target ; } } else { throw new RuntimeException ( sprintf ( 'URI "%s" does not belong to route map. Cannot get a controller in %s' , $ uriTemplate , __METHOD__ ) ) ; } }
Gets associated options by URI template

@param string $uriTemplate
@param string $option Optionally can be filtered by some existing option
@return array
Gets associated options by URI template