W3cubDocs

/Drupal 8

protected property FormState::$temporary

Holds temporary data accessible during the current page request only.

All $form_state properties that are not reserved keys (see other properties marked as uncacheable) persist throughout a multistep form sequence. Form API provides this key for modules to communicate information across form-related functions during a single page request. It may be used to temporarily save data that does not need to or should not be cached during the whole form workflow; e.g., data that needs to be accessed during the current form build process only. There is no use-case for this functionality in Drupal core.

This property is uncacheable.

Type: array

File

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

Class

FormState
Stores information about the state of a form.

Namespace

Drupal\Core\Form

Code

protected $temporary = [];

© 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::temporary/8.1.x