interface UrlGenerator

Methods

string
current()

Get the current URL for the request.

string
to(string $path, mixed $extra = [], bool $secure = null)

Generate an absolute URL to the given path.

string
secure(string $path, array $parameters = [])

Generate a secure, absolute URL to the given path.

string
asset(string $path, bool $secure = null)

Generate the URL to an application asset.

string
route(string $name, mixed $parameters = [], bool $absolute = true)

Get the URL to a named route.

string
action(string $action, mixed $parameters = [], bool $absolute = true)

Get the URL to a controller action.

$this
setRootControllerNamespace(string $rootNamespace)

Set the root controller namespace.

Details

at line 12
string current()

Get the current URL for the request.

Return Value

string

at line 22
string to(string $path, mixed $extra = [], bool $secure = null)

Generate an absolute URL to the given path.

Parameters

string $path
mixed $extra
bool $secure

Return Value

string

at line 31
string secure(string $path, array $parameters = [])

Generate a secure, absolute URL to the given path.

Parameters

string $path
array $parameters

Return Value

string

at line 40
string asset(string $path, bool $secure = null)

Generate the URL to an application asset.

Parameters

string $path
bool $secure

Return Value

string

at line 52
string route(string $name, mixed $parameters = [], bool $absolute = true)

Get the URL to a named route.

Parameters

string $name
mixed $parameters
bool $absolute

Return Value

string

Exceptions

InvalidArgumentException

at line 62
string action(string $action, mixed $parameters = [], bool $absolute = true)

Get the URL to a controller action.

Parameters

string $action
mixed $parameters
bool $absolute

Return Value

string

at line 70
$this setRootControllerNamespace(string $rootNamespace)

Set the root controller namespace.

Parameters

string $rootNamespace

Return Value

$this