class RequestContext
Holds information about the current request.
This class implements a fluent interface.
Methods
__construct(string $baseUrl = '', string $method = 'GET', string $host = 'localhost', string $scheme = 'http', int $httpPort = 80, int $httpsPort = 443, string $path = '/', string $queryString = '') Constructor. | ||
RequestContext | fromRequest(Request $request) Updates the RequestContext information based on a HttpFoundation Request. | |
string | getBaseUrl() Gets the base URL. | |
RequestContext | setBaseUrl(string $baseUrl) Sets the base URL. | |
string | getPathInfo() Gets the path info. | |
RequestContext | setPathInfo(string $pathInfo) Sets the path info. | |
string | getMethod() Gets the HTTP method. | |
RequestContext | setMethod(string $method) Sets the HTTP method. | |
string | getHost() Gets the HTTP host. | |
RequestContext | setHost(string $host) Sets the HTTP host. | |
string | getScheme() Gets the HTTP scheme. | |
RequestContext | setScheme(string $scheme) Sets the HTTP scheme. | |
int | getHttpPort() Gets the HTTP port. | |
RequestContext | setHttpPort(int $httpPort) Sets the HTTP port. | |
int | getHttpsPort() Gets the HTTPS port. | |
RequestContext | setHttpsPort(int $httpsPort) Sets the HTTPS port. | |
string | getQueryString() Gets the query string. | |
RequestContext | setQueryString(string $queryString) Sets the query string. | |
array | getParameters() Returns the parameters. | |
RequestContext | setParameters(array $parameters) Sets the parameters. | |
mixed | getParameter(string $name) Gets a parameter value. | |
bool | hasParameter(string $name) Checks if a parameter value is set for the given parameter. | |
RequestContext | setParameter(string $name, mixed $parameter) Sets a parameter value. |
Details
__construct(string $baseUrl = '', string $method = 'GET', string $host = 'localhost', string $scheme = 'http', int $httpPort = 80, int $httpsPort = 443, string $path = '/', string $queryString = '')
Constructor.
RequestContext fromRequest(Request $request)
Updates the RequestContext information based on a HttpFoundation Request.
string getBaseUrl()
Gets the base URL.
RequestContext setBaseUrl(string $baseUrl)
Sets the base URL.
string getPathInfo()
Gets the path info.
RequestContext setPathInfo(string $pathInfo)
Sets the path info.
string getMethod()
Gets the HTTP method.
The method is always an uppercased string.
RequestContext setMethod(string $method)
Sets the HTTP method.
string getHost()
Gets the HTTP host.
The host is always lowercased because it must be treated case-insensitive.
RequestContext setHost(string $host)
Sets the HTTP host.
string getScheme()
Gets the HTTP scheme.
RequestContext setScheme(string $scheme)
Sets the HTTP scheme.
int getHttpPort()
Gets the HTTP port.
RequestContext setHttpPort(int $httpPort)
Sets the HTTP port.
int getHttpsPort()
Gets the HTTPS port.
RequestContext setHttpsPort(int $httpsPort)
Sets the HTTPS port.
string getQueryString()
Gets the query string.
RequestContext setQueryString(string $queryString)
Sets the query string.
array getParameters()
Returns the parameters.
RequestContext setParameters(array $parameters)
Sets the parameters.
mixed getParameter(string $name)
Gets a parameter value.
bool hasParameter(string $name)
Checks if a parameter value is set for the given parameter.
RequestContext setParameter(string $name, mixed $parameter)
Sets a parameter value.
Please login to continue.