W3cubDocs

/Drupal 8

protected property 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 100

Class

FormState
Stores information about the state of a form.

Namespace

Drupal\Core\Form

Code

protected $rebuild = FALSE;

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Form!FormState.php/property/FormState::rebuild/8.1.x