class Url (View source)

A collection of tools dealing with urls

Methods

static string
getPath(Request $request)

Get the path for the request relative to the home url

static string
addLeadingSlash(string $url)

Ensure url has a leading slash

static string
removeLeadingSlash(string $url)

Ensure url does not have a leading slash

static string
addTrailingSlash(string $url)

Ensure url has a trailing slash

static string
removeTrailingSlash(string $url)

Ensure url does not have a trailing slash

Details

static string getPath(Request $request)

Get the path for the request relative to the home url

Parameters

Request $request

Return Value

string

static string addLeadingSlash(string $url)

Ensure url has a leading slash

Parameters

string $url

Return Value

string

static string removeLeadingSlash(string $url)

Ensure url does not have a leading slash

Parameters

string $url

Return Value

string

static string addTrailingSlash(string $url)

Ensure url has a trailing slash

Parameters

string $url

Return Value

string

static string removeTrailingSlash(string $url)

Ensure url does not have a trailing slash

Parameters

string $url

Return Value

string