创建URL
@param string $route
@param array $params
@param string $ampersand
@return string
@throws \Exception
194786
public function createUrl($route, $params = [], $ampersand = '&')
    {
        unset($params[$this->routeVar]);
        foreach ($params as $i => $param) {
            ($param === null) && ($params[$i] = '');
        }
        // 锚点处理
        if (isset($params['#'])) {
            $anchor = '#' . $params['#'];
            unset($params['#']);
        } else {
            $anchor = '';
        }
        $route = trim($route, '/');
        foreach ($this->_rules as $i => $rule) {
            if (($url = $rule->createPathInfo($this, $route, $params, $ampersand)) !== false) {
                return $this->getBaseUrl() . '/' . $url . $anchor;
            }
        }
        if ($this->throwNotMatchRule) {
            // 不匹配规则时抛出异常
            throw new Exception(str_cover('创建URL时，路由"{route}"找不到对应的规则，请确认路由或规则是否正确', [
                '{route}' => $route,
            ]), 100900102);
        } else {
            return $this->createUrlDefault($route, $params, $ampersand) . $anchor;
        }
    }
1131822
public function url($name, $params = array())
	{
		if ( ! array_key_exists($name, $this->routes))
		{
			throw new \UnexpectedValueException("A route with the name {$name} was not found");
		}

		$route = $this->routes[$name];
		return $route->url($params);
	}
364516
public static function a($text = '', $route = '', Array $params = [], $options = [])
    {
        $optionsHtml = '';
        array_walk($options, function ($value, $key) use (&$optionsHtml) {
            $optionsHtml .= $key . '="' . $value . '" ';
        });
        return '<a href="' . self::url($route, $params) . '" ' . $optionsHtml . ' >' . $text . '</a>';
    }
624828
public function absoluteURIFor(UriInterface $uri, $route, array $params = [], array $query = [])
    {
        $path = $this->uriFor($route, $params);

        return (string) $uri
            ->withUserInfo('')
            ->withPath($path)
            ->withQuery(http_build_query($query))
            ->withFragment('');
    }
19780
public function getSlug($route, $params = [])
    {
        $dbRoute = Yii::$app->cache->get([$route, $params]);
        if (YII_ENV_DEV || $dbRoute == false) {
            $dbRoute = UrlRule::getRoute($route, $params);
            Yii::$app->cache->set(
                [$route, $params],
                $dbRoute
            );
        }
        return $dbRoute;
    }
843849
protected function breadcrumbsIndex($route, $parsedRoute) {
        $urlContext = [];
        if (isset($parsedRoute['params'])) {
            if (isset($parsedRoute['params']['session'])) {
                $session = $parsedRoute['params']['session'];
                $urlContext['session'] = is_array($session) ? implode(',', $session) : $session;
            }
            if (isset($parsedRoute['params']['delivery'])) {
                $urlContext['delivery'] = $parsedRoute['params']['delivery'];
            }
            if (isset($parsedRoute['params']['context'])) {
                $urlContext['context'] = $parsedRoute['params']['context'];
            }
        }

        $breadcrumbs = array(
            'id' => 'history',
            'url' => _url('sessionHistory', 'Reporting', 'taoProctoring', $urlContext),
            'label' => __('Session history')
        );

        return $breadcrumbs;
    }
63115
public function createPathInfo(UrlManager $urlManager, $route, $params, $ampersand)
    {
        $tr = [];
        if ($route !== $this->route) {
            if (null !== $this->routePattern && preg_match($this->routePattern, $route, $m)) {
                foreach ($this->references as $key => $name) {
                    $tr[$name] = $m[$key];
                }
            } else {
                return false;
            }
        }
        // 默认参数
        foreach ($this->defaultParams as $key => $value) {
            if (isset($params[$key])) { // 一旦设置必须和配置的一致
                if ($params[$key] == $value) {
                    unset($params[$key]);
                } else {
                    return false;
                }
            }
        }
        // 规定参数必须设置，否则不匹配该规则
        foreach ($this->params as $key => $value) {
            if (!isset($this->params[$key])) {
                return false;
            }
            $tr["<$key>"] = urlencode($params[$key]);
            unset($params[$key]);
        }
        $url = strtr($this->template, $tr);
        if (empty($params)) {
            return $url !== '' ? $url . $urlManager->urlSuffix : $url;
        }
        // 还有未在pattern中出现的参数
        if ($this->append) {
            // 允许pathInfo 追加
            $url .= '/' . $urlManager->createPathInfo($params, '/', '/') . $urlManager->urlSuffix;
        } else {
            // 不允许追加时，参数放在 "?" 后面
            if ($url !== '') {
                $url .= $urlManager->urlSuffix;
            }
            $url .= '?' . $urlManager->createPathInfo($params, '=', $ampersand);
        }
        return $url;
    }
444157
public function generateUrl($route, $parameters = array(), $absolute = false)
    {
        return $this->container->get(NyrodevService::class)->generateUrl($route, $parameters, $absolute);
    }
400690
public function redirectToRoute($route, array $params = [], $permanent = false)
    {
        $map = $this->app()->getRouteMap();
        $url = $map->assemble($route, $params);

        return $this->redirect($url, $permanent);
    }
1323918
public static function fromRoute(Route $route, array $params = []): self
    {
        $result = new self();
        $result->success = true;
        $result->route = $route;
        $result->matchedParams = $params;

        return $result;
    }
892231
public function path($route, $parameters = array())
    {
        return $this->urlGenerator->generate($route, $parameters, UrlGeneratorInterface::ABSOLUTE_PATH);
    }
526236
protected function generateUrl($route, $parameters = array(), $absolute = false)
    {
        return $this->getService('Router')->generate($route, $parameters, $absolute);
    }
1308384
public function path($route, $parameters = array())
    {
        return $this->silex['url_generator']->generate($route, $parameters, \Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_PATH);
    }
1322206
protected function getRouteDomain($route, &$parameters)
    {
        return $route->getDomain() ? $this->formatDomain($route, $parameters) : null;
    }
192071
public function printUrl($route)
    {
        if (empty($route)) {
            return '';
        }

        try {
            $url = $this
                ->urlGenerator
                ->generate($route);
        } catch (ExceptionInterface $e) {
            $url = (string) $route;
        }

        return $url;
    }
252682
protected function redirectTo($route, array $parameters = [])
    {
        $url = $this->url->toRoute($route, $parameters);

        return $this->makeRedirect($url);
    }
778963
public function getIndexUrl(array $params = array(), array $options = array())
    {
        return $this->url()->fromRoute($this->getEvent()->getRouteMatch()->getMatchedRouteName(),
            array_merge(array('action' => 'index'), $params),
            $options
        );
    }