class ParserContext implements IteratorAggregate

The parser context is an application-wide context, which stores var-value pairs.

Theses pairs are injected in the parser and becomes available to the templates.

Constants

FORM_ERROR_LIFETIME_SECONDS

Methods

__construct( RequestStack $requestStack, TheliaFormFactoryInterface $formFactory, TheliaFormValidatorInterface $formValidator)

No description

$this
pushCurrentForm( BaseForm $form)

Set the current form

BaseForm|null
popCurrentForm( null|BaseForm $default = null)

Set the current form.

getCurrentForm()

No description

$this
addForm( BaseForm $form)

Add a new form to the error form context

null|BaseForm
getForm( string $formId, string $formClass, string $formType)

Check if the specified form has errors, and return an instance of this form if it's the case.

$this
clearForm( BaseForm $form)

Remove form from the saved form error information.

setGeneralError($error)

No description

set($name, $value)

No description

remove($name)

No description

get($name, $default = null)

No description

getIterator()

No description

getSession()

No description

Details

at line 46
__construct( RequestStack $requestStack, TheliaFormFactoryInterface $formFactory, TheliaFormValidatorInterface $formValidator)

Parameters

RequestStack $requestStack
TheliaFormFactoryInterface $formFactory
TheliaFormValidatorInterface $formValidator

at line 68
$this pushCurrentForm( BaseForm $form)

Set the current form

Parameters

BaseForm $form

Return Value

$this

at line 81
BaseForm|null popCurrentForm( null|BaseForm $default = null)

Set the current form.

Parameters

null|BaseForm $default

Return Value

BaseForm|null

at line 92
getCurrentForm()

at line 132
$this addForm( BaseForm $form)

Add a new form to the error form context

Parameters

BaseForm $form the errored form

Return Value

$this

at line 161
null|BaseForm getForm( string $formId, string $formClass, string $formType)

Check if the specified form has errors, and return an instance of this form if it's the case.

Parameters

string $formId the form ID, as defined in the container
string $formClass the form full qualified class name
string $formType the form type, something like 'form'

Return Value

null|BaseForm null if no error information is available

at line 214
$this clearForm( BaseForm $form)

Remove form from the saved form error information.

Parameters

BaseForm $form

Return Value

$this

at line 251
setGeneralError($error)

Parameters

$error

at line 260
set($name, $value)

Parameters

$name
$value

at line 267
remove($name)

Parameters

$name

at line 274
get($name, $default = null)

Parameters

$name
$default

at line 279
getIterator()

at line 287
Session getSession()

Return Value

Session