public function routeUrl(string $name, array $data = null, bool $absolute = null): string
    {
        // Get the matching route
        $route = $this->route($name);
        // Set the host to use if this is an absolute url
        // or the config is set to always use absolute urls
        // or the route is secure (needs https:// appended)
        $host = $absolute
        || $this->app->config()['routing']['useAbsoluteUrls']
        || $route->isSecure()
            ? $this->routeHost($route)
            : '';
        // Get the path from the generator
        $path = $route->getSegments()
            ? $this->app->pathGenerator()->parse(
                $route->getSegments(),
                $data,
                $route->getParams()
            )
            : $route->getPath();

        return $host . $this->validateRouteUrl($path);
    }
public function routeUrl(string $name, array $data = null, bool $absolute = null): string
    {
        // Get the matching route
        $route = $this->route($name);
        // Set the host to use if this is an absolute url
        // or the config is set to always use absolute urls
        // or the route is secure (needs https:// appended)
        $host = $absolute
        || $this->app->config()['routing']['useAbsoluteUrls']
        || $route->isSecure()
            ? $this->routeHost($route)
            : '';
        // Get the path from the generator
        $path = $route->getSegments()
            ? $this->app->pathGenerator()->parse(
                $route->getSegments(),
                $data,
                $route->getParams()
            )
            : $route->getPath();

        return $host . $this->validateRouteUrl($path);
    }
public function routeUrl ( string $ name , array $ data = null , bool $ absolute = null ) : string { // Get the matching route $ route = $ this -> route ( $ name ) ; // Set the host to use if this is an absolute url // or the config is set to always use absolute urls // or the route is secure (needs https:// appended) $ host = $ absolute || $ this -> app -> config ( ) [ 'routing' ] [ 'useAbsoluteUrls' ] || $ route -> isSecure ( ) ? $ this -> routeHost ( $ route ) : '' ; // Get the path from the generator $ path = $ route -> getSegments ( ) ? $ this -> app -> pathGenerator ( ) -> parse ( $ route -> getSegments ( ) , $ data , $ route -> getParams ( ) ) : $ route -> getPath ( ) ; return $ host . $ this -> validateRouteUrl ( $ path ) ; }
Get a route url by name.

@param string $name     The name of the route to get
@param array  $data     [optional] The route data if dynamic
@param bool   $absolute [optional] Whether this url should be absolute

@throws \Valkyrja\Routing\Exceptions\InvalidRouteName

@return string
Get a route url by name .