RequestHelper

class RequestHelper extends Helper

RequestHelper provides access to the current request parameters.

Methods

setCharset(string $charset)

Sets the default charset.

from Helper
string getCharset()

Gets the default charset.

from Helper
__construct(Request|RequestStack $requestStack) deprecated
mixed getParameter(string $key, string $default = null)

Returns a parameter from the current request object.

string getLocale()

Returns the locale.

string getName()

Returns the canonical name of this helper.

Details

setCharset(string $charset)

Sets the default charset.

Parameters

string $charset The charset

string getCharset()

Gets the default charset.

Return Value

string The default charset

__construct(Request|RequestStack $requestStack) deprecated

deprecated

since version 2.5, passing a Request instance is deprecated and support for it will be removed in 3.0.

Parameters

Request|RequestStack $requestStack A RequestStack instance or a Request instance

mixed getParameter(string $key, string $default = null)

Returns a parameter from the current request object.

Parameters

string $key The name of the parameter
string $default A default value

Return Value

mixed

See also

Request::get()

string getLocale()

Returns the locale.

Return Value

string

string getName()

Returns the canonical name of this helper.

Return Value

string The canonical name

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Bundle/FrameworkBundle/Templating/Helper/RequestHelper.html