UrlGenerator
in
Table of Contents
- action() : string
- Get the URL to a controller action.
- asset() : string
- Generate the URL to an application asset.
- current() : string
- Get the current URL for the request.
- route() : string
- Get the URL to a named route.
- secure() : string
- Generate a secure, absolute URL to the given path.
- setRootControllerNamespace() : $this
- Set the root controller namespace.
- to() : string
- Generate an absolute URL to the given path.
Methods
action()
Get the URL to a controller action.
public
action(string $action[, mixed $parameters = [] ][, bool $absolute = true ]) : string
Parameters
- $action : string
- $parameters : mixed = []
- $absolute : bool = true
Return values
string —asset()
Generate the URL to an application asset.
public
asset(string $path[, bool $secure = null ]) : string
Parameters
- $path : string
- $secure : bool = null
Return values
string —current()
Get the current URL for the request.
public
current() : string
Return values
string —route()
Get the URL to a named route.
public
route(string $name[, mixed $parameters = [] ][, bool $absolute = true ]) : string
Parameters
- $name : string
- $parameters : mixed = []
- $absolute : bool = true
Tags
Return values
string —secure()
Generate a secure, absolute URL to the given path.
public
secure(string $path[, array<string|int, mixed> $parameters = [] ]) : string
Parameters
- $path : string
- $parameters : array<string|int, mixed> = []
Return values
string —setRootControllerNamespace()
Set the root controller namespace.
public
setRootControllerNamespace(string $rootNamespace) : $this
Parameters
- $rootNamespace : string
Return values
$this —to()
Generate an absolute URL to the given path.
public
to(string $path[, mixed $extra = [] ][, bool $secure = null ]) : string
Parameters
- $path : string
- $extra : mixed = []
- $secure : bool = null