W3cubDocs

/Symfony 2.7

Symfony\Bundle\FrameworkBundle\Templating\Helper\SessionHelper

class SessionHelper extends Helper

SessionHelper provides read-only access to the session attributes.

Methods

setCharset(string $charset)

Sets the default charset.

from Helper
string getCharset()

Gets the default charset.

from Helper
__construct(Request|RequestStack $requestStack)

Constructor.

mixed get(string $name, mixed $default = null)

Returns an attribute

getFlash($name, array $default = array())
getFlashes()
hasFlash($name)
string getName()

Returns the canonical name of this helper.

Details

public setCharset(string $charset)

Sets the default charset.

Parameters

string $charset The charset

public string getCharset()

Gets the default charset.

Return Value

string The default charset

public __construct(Request|RequestStack $requestStack)

Constructor.

Parameters

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

public mixed get(string $name, mixed $default = null)

Returns an attribute

Parameters

string $name The attribute name
mixed $default The default value

Return Value

mixed

public getFlash($name, array $default = array())

Parameters

$name
array $default

public getFlashes()

public hasFlash($name)

Parameters

$name

public string getName()

Returns the canonical name of this helper.

Return Value

string The canonical name

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