class RequestContext
Holds information about the current request.
This class implements a fluent interface.
__construct(string $baseUrl = '', string $method = 'GET', string $host = 'localhost', string $scheme = 'http', int $httpPort = 80, int $httpsPort = 443, string $path = '/', string $queryString = '') Constructor. | ||
$this | fromRequest(Request $request) Updates the RequestContext information based on a HttpFoundation Request. | |
string | getBaseUrl() Gets the base URL. | |
$this | setBaseUrl(string $baseUrl) Sets the base URL. | |
string | getPathInfo() Gets the path info. | |
$this | setPathInfo(string $pathInfo) Sets the path info. | |
string | getMethod() Gets the HTTP method. | |
$this | setMethod(string $method) Sets the HTTP method. | |
string | getHost() Gets the HTTP host. | |
$this | setHost(string $host) Sets the HTTP host. | |
string | getScheme() Gets the HTTP scheme. | |
$this | setScheme(string $scheme) Sets the HTTP scheme. | |
int | getHttpPort() Gets the HTTP port. | |
$this | setHttpPort(int $httpPort) Sets the HTTP port. | |
int | getHttpsPort() Gets the HTTPS port. | |
$this | setHttpsPort(int $httpsPort) Sets the HTTPS port. | |
string | getQueryString() Gets the query string. | |
$this | setQueryString(string $queryString) Sets the query string. | |
array | getParameters() Returns the parameters. | |
$this | 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. | |
$this | setParameter(string $name, mixed $parameter) Sets a parameter value. |
Constructor.
Updates the RequestContext information based on a HttpFoundation Request.
Gets the base URL.
Sets the base URL.
Gets the path info.
Sets the path info.
Gets the HTTP method.
The method is always an uppercased string.
Sets the HTTP method.
Gets the HTTP host.
The host is always lowercased because it must be treated case-insensitive.
Sets the HTTP host.
Gets the HTTP scheme.
Sets the HTTP scheme.
Gets the HTTP port.
Sets the HTTP port.
Gets the HTTPS port.
Sets the HTTPS port.
Gets the query string.
Sets the query string.
Returns the parameters.
Sets the parameters.
Gets a parameter value.
Checks if a parameter value is set for the given parameter.
Sets a parameter value.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.1/Symfony/Component/Routing/RequestContext.html