Generate route by name.

@param  string  $name
@param  string  $default

@return \Orchestra\Contracts\Extension\UrlGenerator
432283
protected function generateRouteByName(string $name, string $default)
    {
        if (is_null($this->extension)) {
            return $default;
        }

        return $this->extension->route($name, $default);
    }
626504
public function route($key, $default = null)
    {
        if (isset($this->routeParams[$key])){
            return $this->routeParams[$key];
        }
        return $default;
    }
256124
public function getOption($name, $default = null)
    {
        $data = new Data((array)get_option($this->registry['option_name']));
        return $data->get($name, $default);
    }
714966
public function getNamedRoute(string $name) : Route
    {
        $this->buildNameIndex();

        if (isset($this->namedRoutes[$name])) {
            return $this->namedRoutes[$name];
        }

        throw new InvalidArgumentException(sprintf('No route of the name (%s) exists', $name));
    }
652687
public static function referString($name, $default = null)
    {
        $res = self::getReferParams($name);
        if (!is_null($res)) return self::parseInputToString($res);
        return $default;
    }
323541
public function getServer($name = null, $default = '')
    {
        $context = $this->_context;

        if ($name === null) {
            return $context->_SERVER;
        } else {
            return isset($context->_SERVER[$name]) ? $context->_SERVER[$name] : $default;
        }
    }
168136
public function get( $name, $default = null )
	{
		if( ( $entry = $this->object->get( $this->prefix . $name ) ) !== false ) {
			return $entry;
		}

		return $default;
	}
1047371
public function server($name, $default = null)
    {
        return array_key_exists($name, $this->server) ? $this->server[$name] : $default;
    }
965
public function getRouteDefinitionByName(string $name): RouteDefinition
    {
        if (!isset($this->routesByName[$name])) {
            throw new \InvalidArgumentException("Invalid route name '$name'");
        }

        return $this->getRouteDefinition($this->routesByName[$name]);
    }
627289
public static function get(string $name, $default = null)
    {
        $names = Imi::parseDotRule($name);
        if (isset($names[0]))
        {
            $first = array_shift($names);
            if('@currentServer' === $first)
            {
                if($isCurrentServer = (RequestContext::exsits() && null !== ($server = RequestContext::getServer())))
                {
                    $first = '@server';
                    array_unshift($names, $server->getName());
                }
                else
                {
                    $first = '@app';
                }
            }
            else
            {
                $isCurrentServer = false;
            }
            if(isset(static::$configs[$first]))
            {
                $result = static::$configs[$first]->get($names, null);
            }
            if(isset($result))
            {
                return $result;
            }
            else if($isCurrentServer)
            {
                $first = '@app';
                array_shift($names);
                return static::$configs[$first]->get($names, $default);
            }
        }
        return $default;
    }
769192
public function route(string $name, string $default = '/'): UrlGenerator
    {
        // Boot the application.
        $this->boot();

        return parent::route($name, $default);
    }
839841
protected function getQueryParam($name, $default = null)
    {
        return isset($this->request->getQueryParams()[$name]) ? $this->request->getQueryParams()[$name] : $default;
    }
17140
public function getQueryParam($name, $default = null)
    {
        if (isset($this->queryParams[$name])) {
            return $this->queryParams[$name];
        }

        return $default;
    }
803077
public function get(string $name, $default = null)
    {
        return isset($this->options[$name]) ? $this->options[$name] : $default;
    }
1338719
private function resolveName($name)
    {
        if ($name !== null) {
            return $name;
        }

        if (!isset($this->defaults['route'])) {
            throw new RouterException('Unable to make "self" url - default route was not defined.');
        }

        return $this->defaults['route'];
    }
428774
public function getHeader($name, $default = null)
    {
        $context = $this->_context;

        return isset($context->headers[$name]) ? $context->headers[$name] : $default;
    }
1270085
public function generate($name, $parameters = array(), $absolute = false)
    {
        $this->urlGenerator = new UrlGenerator($this->routeCollection, $this->context);

        return $this->urlGenerator->generate($name, $parameters, $absolute);
    }