RouteUrlGenerator
class RouteUrlGenerator
Properties
| protected UrlGenerator | $url | The URL generator instance. |
|
| array | $defaultParameters | The global named parameter defaults. |
|
| array | $dontEncode | Characters that should not be URL encoded. |
Methods
Format the array of route parameters.
Replace the parameters on the root path.
Replace the port in a root URL with the route's configured port.
Replace all of the wildcard parameters for a route path.
Replace all of the named parameters in the path.
Add a query string to the URI.
Get the query string for a given route.
Get the string parameters from a given list.
Get the numeric parameters from a given list.
Set the default named parameters used by the URL generator.
Details
at line 51
__construct(UrlGenerator $url)
Create a new route URL generator.
at line 61
string
to(Route $route, mixed $parameters = [], bool $absolute = false)
Generate a URL for the given route.
at line 102
protected string|null
getRouteDomain(Route $route, array $parameters)
Get the formatted domain for a given route.
at line 110
protected string
formatDomain(Route $route, array $parameters)
Format the domain and port for the route and request.
at line 121
protected string
getRouteScheme(Route $route)
Get the scheme for the given route.
at line 136
protected string
addPortToDomain(string $domain, Route|null $route = null)
Add the port to the domain if necessary.
at line 152
protected bool
isRouteSecure(Route $route)
Determine if the route uses HTTPS.
at line 168
protected array
formatParameters(Route $route, mixed $parameters, array $defaultParameters)
Format the array of route parameters.
at line 299
protected string
replaceRootParameters(Route $route, string|null $domain, array $parameters, array $defaultParameters)
Replace the parameters on the root path.
at line 322
protected string
replacePortInRoot(string $root, Route $route)
Replace the port in a root URL with the route's configured port.
at line 342
protected string
replaceRouteParameters(string $path, array $parameters, array $defaultParameters)
Replace all of the wildcard parameters for a route path.
at line 364
protected string
replaceNamedParameters(string $path, array $parameters, array $defaultParameters)
Replace all of the named parameters in the path.
at line 387
protected string
addQueryString(string $uri, array $parameters)
Add a query string to the URI.
at line 404
protected string
getRouteQueryString(array $parameters)
Get the query string for a given route.
at line 435
protected array
getStringParameters(array $parameters)
Get the string parameters from a given list.
at line 443
protected array
getNumericParameters(array $parameters)
Get the numeric parameters from a given list.
at line 451
void
defaults(array $defaults)
Set the default named parameters used by the URL generator.