Url
class Url (View source)
A collection of tools dealing with URLs.
Methods
static string
getPath(RequestInterface $request, string $home_url = '')
Get the path for the request relative to the home url.
static string
addLeadingSlash(string $url, boolean $leave_blank = false)
Ensure url has a leading slash
static string
removeLeadingSlash(string $url)
Ensure url does not have a leading slash
static string
addTrailingSlash(string $url, boolean $leave_blank = false)
Ensure url has a trailing slash
static string
removeTrailingSlash(string $url)
Ensure url does not have a trailing slash
Details
at line 27
static string
getPath(RequestInterface $request, string $home_url = '')
Get the path for the request relative to the home url.
Works only with absolute URLs.
at line 58
static string
addLeadingSlash(string $url, boolean $leave_blank = false)
Ensure url has a leading slash
at line 72
static string
removeLeadingSlash(string $url)
Ensure url does not have a leading slash
at line 83
static string
addTrailingSlash(string $url, boolean $leave_blank = false)
Ensure url has a trailing slash
at line 97
static string
removeTrailingSlash(string $url)
Ensure url does not have a trailing slash