FormState::$rebuild

Normally, after the entire form processing is completed and submit handlers have run, a form is considered to be done and \Drupal\Core\Form\FormSubmitterInterface::redirectForm() will redirect the user to a new page using a GET request (so a browser refresh does not re-submit the form). However, if 'rebuild' has been set to TRUE, then a new copy of the form is immediately built and sent to the browser, instead of a redirect. This is used for multi-step forms, such as wizards and confirmation forms. Normally, self::$rebuild is set by a submit handler, since its is usually logic within a submit handler that determines whether a form is done or requires another step. However, a validation handler may already set self::$rebuild to cause the form processing to bypass submit handlers and rebuild the form instead, even if there are no validation errors.

This property is uncacheable.

Type: bool

See also

self::setRebuild()

File

core/lib/Drupal/Core/Form/FormState.php, line 102

Class

FormState
Stores information about the state of a form.

Namespace

Drupal\Core\Form

Code

protected $rebuild = FALSE;
doc_Drupal
2016-10-29 09:15:51
Comments
Leave a Comment

Please login to continue.