Url
in package
Url
This class is responsible for working with urls. Includes helper methods for getting urls, for parsing and manipulating query variables.
Table of Contents
Methods
- getCurrentUrl() : string
- This method returns the actual url of the request.
- getUrl() : string
- This method converts a relative public path to an absolute one and returns a url.
- getVars() : string
- This method parses the url and returns a query string.
- setVars() : string
- This method parses the query string and sets or updates the new query variables passed as the second argument.
- varsToArray() : array<string|int, mixed>
- This method converts a query string to an array of query variables.
- varsToString() : string
- This method converts an array of queries to a query string.
Methods
getCurrentUrl()
This method returns the actual url of the request.
public
static getCurrentUrl() : string
Return values
stringgetUrl()
This method converts a relative public path to an absolute one and returns a url.
public
static getUrl([string $path = '/' ]) : string
Parameters
- $path : string = '/'
Return values
stringgetVars()
This method parses the url and returns a query string.
public
static getVars(string $url) : string
Parameters
- $url : string
Return values
stringsetVars()
This method parses the query string and sets or updates the new query variables passed as the second argument.
public
static setVars(string $url, array<string|int, mixed> $query_vars) : string
Parameters
- $url : string
- $query_vars : array<string|int, mixed>
Return values
stringvarsToArray()
This method converts a query string to an array of query variables.
public
static varsToArray(string $query_string) : array<string|int, mixed>
Parameters
- $query_string : string
Return values
array<string|int, mixed>varsToString()
This method converts an array of queries to a query string.
public
static varsToString(array<string|int, mixed> $query_vars) : string
Parameters
- $query_vars : array<string|int, mixed>