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 = '') | ||
$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. |
string | $baseUrl | |
string | $method | |
string | $host | |
string | $scheme | |
int | $httpPort | |
int | $httpsPort | |
string | $path | |
string | $queryString |
Updates the RequestContext information based on a HttpFoundation Request.
Request | $request |
$this |
Gets the base URL.
string | The base URL |
Sets the base URL.
string | $baseUrl | The base URL |
$this |
Gets the path info.
string | The path info |
Sets the path info.
string | $pathInfo | The path info |
$this |
Gets the HTTP method.
The method is always an uppercased string.
string | The HTTP method |
Sets the HTTP method.
string | $method | The HTTP method |
$this |
Gets the HTTP host.
The host is always lowercased because it must be treated case-insensitive.
string | The HTTP host |
Sets the HTTP host.
string | $host | The HTTP host |
$this |
Gets the HTTP scheme.
string | The HTTP scheme |
Sets the HTTP scheme.
string | $scheme | The HTTP scheme |
$this |
Gets the HTTP port.
int | The HTTP port |
Sets the HTTP port.
int | $httpPort | The HTTP port |
$this |
Gets the HTTPS port.
int | The HTTPS port |
Sets the HTTPS port.
int | $httpsPort | The HTTPS port |
$this |
Gets the query string.
string | The query string without the "?" |
Sets the query string.
string | $queryString | The query string (after "?") |
$this |
Returns the parameters.
array | The parameters |
Sets the parameters.
array | $parameters | The parameters |
$this |
Gets a parameter value.
string | $name | A parameter name |
mixed | The parameter value or null if nonexistent |
Checks if a parameter value is set for the given parameter.
string | $name | A parameter name |
bool | True if the parameter value is set, false otherwise |
Sets a parameter value.
string | $name | A parameter name |
mixed | $parameter | The parameter value |
$this |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Routing/RequestContext.html