Stores information about the state of a form.
Hierarchy
- class \Drupal\Core\Form\FormState implements FormStateInterface uses FormStateValuesTrait
File
- core/lib/Drupal/Core/Form/FormState.php, line 12
Namespace
Drupal\Core\Form
Members
Name | Modifiers | Type | Description |
---|---|---|---|
FormState::$always_process | protected | property | If TRUE and the method is GET, a form_id is not necessary. |
FormState::$anyErrors | protected static | property | Tracks if any errors have been set on any form. |
FormState::$build_info | protected | property | An associative array of information stored by Form API that is necessary to build and rebuild the form from cache when the original context may no longer be available: |
FormState::$buttons | protected | property | A list containing copies of all submit and button elements in the form. |
FormState::$cache | protected | property | If set to TRUE the original, unprocessed form structure will be cached, which allows the entire form to be rebuilt from cache. A typical form workflow involves two page requests; first, a form is built and rendered for the user to fill in. Then, the… |
FormState::$cleanValueKeys | protected | property | An associative array of form value keys to be removed by cleanValues(). |
FormState::$complete_form | protected | property | The complete form structure. |
FormState::$errors | protected | property | Contains errors for this form. |
FormState::$executed | protected | property | If TRUE, the form was submitted and has been processed and executed. |
FormState::$groups | protected | property | Contains references to details elements to render them within vertical tabs. |
FormState::$has_file_element | protected | property | If TRUE, there is a file element and Form API will set the appropriate 'enctype' HTML attribute on the form. |
FormState::$input | protected | property | The array of values as they were submitted by the user. |
FormState::$invalidToken | protected | property | If set to TRUE the form will skip calling form element value callbacks, except for a select list of callbacks provided by Drupal core that are known to be safe. |
FormState::$limit_validation_errors | protected | property | Stores which errors should be limited during validation. |
FormState::$method | protected | property | The HTTP form method to use for finding the input for this form. |
FormState::$must_validate | protected | property | Ordinarily, a form is only validated once, but there are times when a form is resubmitted internally and should be validated again. Setting this to TRUE will force that to happen. This is most likely to occur during Ajax operations. |
FormState::$no_cache | protected | property | If set to TRUE the form will NOT be cached, even if 'cache' is set. |
FormState::$no_redirect | protected | property | If set to TRUE the form will NOT perform a redirect, even if self::$redirect is set. |
FormState::$process_input | protected | property | TRUE signifies correct form submission. This is always TRUE for programmed forms coming from \Drupal\Core\Form\FormBuilderInterface::submitForm() (see 'programmed' key), or if the form_id coming from the \Drupal::request()->request data… |
FormState::$programmed | protected | property | If TRUE, the form was submitted programmatically, usually invoked via \Drupal\Core\Form\FormBuilderInterface::submitForm(). Defaults to FALSE. |
FormState::$programmed_bypass_access_check | protected | property | If TRUE, programmatic form submissions are processed without taking #access into account. Set this to FALSE when submitting a form programmatically with values that may have been input by the user executing the current request; this will cause #access… |
FormState::$rebuild | protected | property | 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… |
FormState::$rebuild_info | protected | property | Similar to self::$build_info, but pertaining to \Drupal\Core\Form\FormBuilderInterface::rebuildForm(). |
FormState::$redirect | protected | property | Used to redirect the form on submission. |
FormState::$requestMethod | protected | property | The HTTP method used by the request building or processing this form. |
FormState::$response | protected | property | Used when a form needs to return some kind of a \Symfony\Component\HttpFoundation\Response object, e.g., a \Symfony\Component\HttpFoundation\BinaryFileResponse when triggering a file download. If you use self::setRedirect() or… |
FormState::$storage | protected | property | This is not a special key, and no specific support is provided for it in the Form API. By tradition it was the location where application-specific data was stored for communication between the submit, validation, and form builder functions, especially… |
FormState::$submitted | protected | property | If TRUE, the form has been submitted. Defaults to FALSE. |
FormState::$submit_handlers | protected | property | Stores the gathered submission handlers. |
FormState::$temporary | protected | property | Holds temporary data accessible during the current page request only. |
FormState::$triggering_element | protected | property | The form element that triggered submission, which may or may not be a button (in the case of Ajax forms). This key is often used to distinguish between various buttons in a submit handler, and is also used in Ajax handlers. |
FormState::$validate_handlers | protected | property | Stores the gathered validation handlers. |
FormState::$validation_complete | protected | property | Tracks if the form has finished validation. |
FormState::$values | protected | property | An associative array of values submitted to the form. |
FormState::addBuildInfo | public | function | Adds a value to the build info. Overrides FormStateInterface::addBuildInfo |
FormState::addCleanValueKey | public | function | Adds a key to the array of form values that will be cleaned. Overrides FormStateInterface::addCleanValueKey |
FormState::addRebuildInfo | public | function | Adds a value to the rebuild info. Overrides FormStateInterface::addRebuildInfo |
FormState::cleanValues | public | function | Removes internal Form API elements and buttons from submitted form values. Overrides FormStateInterface::cleanValues |
FormState::clearErrors | public | function | Clears all errors against all form elements made by self::setErrorByName(). Overrides FormStateInterface::clearErrors |
FormState::disableCache | public | function | Prevents the form from being cached. Overrides FormStateInterface::disableCache |
FormState::disableRedirect | public | function | Prevents the form from redirecting. Overrides FormStateInterface::disableRedirect |
FormState::get | public | function | Gets any arbitrary property. Overrides FormStateInterface::get |
FormState::getAlwaysProcess | public | function | Determines if this form should always be processed. Overrides FormStateInterface::getAlwaysProcess |
FormState::getBuildInfo | public | function | Returns the build info for the form. Overrides FormStateInterface::getBuildInfo |
FormState::getButtons | public | function | Returns the submit and button elements for the form. Overrides FormStateInterface::getButtons |
FormState::getCacheableArray | public | function | Returns an array representation of the cacheable portion of the form state. Overrides FormStateInterface::getCacheableArray |
FormState::getCleanValueKeys | public | function | Gets the keys of the form values that will be cleaned. Overrides FormStateInterface::getCleanValueKeys |
FormState::getCompleteForm | public | function | Returns a reference to the complete form array. Overrides FormStateInterface::getCompleteForm |
FormState::getError | public | function | Returns the error message filed against the given form element. Overrides FormStateInterface::getError |
FormState::getErrors | public | function | Returns an associative array of all errors. Overrides FormStateInterface::getErrors |
FormState::getFormObject | public | function | Returns the form object that is responsible for building this form. Overrides FormStateInterface::getFormObject |
FormState::getGroups | public | function | Returns references to details elements to render them within vertical tabs. Overrides FormStateInterface::getGroups |
FormState::getLimitValidationErrors | public | function | Retrieves the limited validation error sections. Overrides FormStateInterface::getLimitValidationErrors |
FormState::getRebuildInfo | public | function | Gets the rebuild info. Overrides FormStateInterface::getRebuildInfo |
FormState::getRedirect | public | function | Gets the value to use for redirecting after the form has been executed. Overrides FormStateInterface::getRedirect |
FormState::getResponse | public | function | Gets a response for this form. Overrides FormStateInterface::getResponse |
FormState::getStorage | public | function | Returns the entire set of arbitrary data. Overrides FormStateInterface::getStorage |
FormState::getSubmitHandlers | public | function | Gets the submit handlers. Overrides FormStateInterface::getSubmitHandlers |
FormState::getTemporary | public | function | Gets temporary data. Overrides FormStateInterface::getTemporary |
FormState::getTemporaryValue | public | function | Gets an arbitrary value from temporary storage. Overrides FormStateInterface::getTemporaryValue |
FormState::getTriggeringElement | public | function | Gets the form element that triggered submission. Overrides FormStateInterface::getTriggeringElement |
FormState::getUserInput | public | function | Returns the form values as they were submitted by the user. Overrides FormStateInterface::getUserInput |
FormState::getValidateHandlers | public | function | Gets the validate handlers. Overrides FormStateInterface::getValidateHandlers |
FormState::getValues | public | function | Implements \Drupal\Core\Form\FormStateInterface::getValues() Overrides FormStateValuesTrait::getValues |
FormState::has | public | function | Determines if an arbitrary property is present. Overrides FormStateInterface::has |
FormState::hasAnyErrors | public static | function | Determines if any forms have any errors. Overrides FormStateInterface::hasAnyErrors |
FormState::hasFileElement | public | function | Returns whether this form has a file element. Overrides FormStateInterface::hasFileElement |
FormState::hasInvalidToken | public | function | Determines if the form has an invalid token. Overrides FormStateInterface::hasInvalidToken |
FormState::hasTemporaryValue | public | function | Determines if a temporary value is present. Overrides FormStateInterface::hasTemporaryValue |
FormState::isBypassingProgrammedAccessChecks | public | function | Determines if this form submission should bypass #access. Overrides FormStateInterface::isBypassingProgrammedAccessChecks |
FormState::isCached | public | function | Determines if the form should be cached. Overrides FormStateInterface::isCached |
FormState::isExecuted | public | function | Determines if the form was submitted and has been processed and executed. Overrides FormStateInterface::isExecuted |
FormState::isMethodType | public | function | Returns the HTTP form method. Overrides FormStateInterface::isMethodType |
FormState::isProcessingInput | public | function | Determines if the form input will be processed. Overrides FormStateInterface::isProcessingInput |
FormState::isProgrammed | public | function | Returns if this form was submitted programmatically. Overrides FormStateInterface::isProgrammed |
FormState::isRebuilding | public | function | Determines if the form should be rebuilt after processing. Overrides FormStateInterface::isRebuilding |
FormState::isRedirectDisabled | public | function | Determines if redirecting has been prevented. Overrides FormStateInterface::isRedirectDisabled |
FormState::isRequestMethodSafe | protected | function | Checks whether the request method is a "safe" HTTP method. |
FormState::isSubmitted | public | function | Determines if the form has been submitted. Overrides FormStateInterface::isSubmitted |
FormState::isValidationComplete | public | function | Determines if validation has been completed. Overrides FormStateInterface::isValidationComplete |
FormState::isValidationEnforced | public | function | Checks if validation is enforced. Overrides FormStateInterface::isValidationEnforced |
FormState::loadInclude | public | function | Ensures an include file is loaded whenever the form is processed. Overrides FormStateInterface::loadInclude |
FormState::moduleLoadInclude | protected | function | Wraps ModuleHandler::loadInclude(). |
FormState::prepareCallback | public | function | Converts support notations for a form callback to a valid callable. Overrides FormStateInterface::prepareCallback |
FormState::set | public | function | Sets a value to an arbitrary property. Overrides FormStateInterface::set |
FormState::setAlwaysProcess | public | function | Sets this form to always be processed. Overrides FormStateInterface::setAlwaysProcess |
FormState::setAnyErrors | protected static | function | Sets the global status of errors. |
FormState::setBuildInfo | public | function | Sets the build info for the form. Overrides FormStateInterface::setBuildInfo |
FormState::setButtons | public | function | Stores the submit and button elements for the form. Overrides FormStateInterface::setButtons |
FormState::setCached | public | function | Sets this form to be cached. Overrides FormStateInterface::setCached |
FormState::setCleanValueKeys | public | function | Sets the keys of the form values that will be cleaned. Overrides FormStateInterface::setCleanValueKeys |
FormState::setCompleteForm | public | function | Stores the complete form array. Overrides FormStateInterface::setCompleteForm |
FormState::setError | public | function | Flags an element as having an error. Overrides FormStateInterface::setError |
FormState::setErrorByName | public | function | Files an error against a form element. Overrides FormStateInterface::setErrorByName |
FormState::setExecuted | public | function | Sets that the form was submitted and has been processed and executed. Overrides FormStateInterface::setExecuted |
FormState::setFormObject | public | function | Sets the form object that is responsible for building this form. Overrides FormStateInterface::setFormObject |
FormState::setFormState | public | function | Sets the value of the form state. Overrides FormStateInterface::setFormState |
FormState::setGroups | public | function | Sets references to details elements to render them within vertical tabs. Overrides FormStateInterface::setGroups |
FormState::setHasFileElement | public | function | Sets that this form has a file element. Overrides FormStateInterface::setHasFileElement |
FormState::setInvalidToken | public | function | Flags the form state as having or not an invalid token. Overrides FormStateInterface::setInvalidToken |
FormState::setLimitValidationErrors | public | function | Sets the limited validation error sections. Overrides FormStateInterface::setLimitValidationErrors |
FormState::setMethod | public | function | Sets the HTTP method to use for the form's submission. Overrides FormStateInterface::setMethod |
FormState::setProcessInput | public | function | Sets that the form should process input. Overrides FormStateInterface::setProcessInput |
FormState::setProgrammed | public | function | Sets that this form was submitted programmatically. Overrides FormStateInterface::setProgrammed |
FormState::setProgrammedBypassAccessCheck | public | function | Sets if this form submission should bypass #access. Overrides FormStateInterface::setProgrammedBypassAccessCheck |
FormState::setRebuild | public | function | Sets the form to be rebuilt after processing. Overrides FormStateInterface::setRebuild |
FormState::setRebuildInfo | public | function | Sets the rebuild info. Overrides FormStateInterface::setRebuildInfo |
FormState::setRedirect | public | function | Sets the redirect for the form. Overrides FormStateInterface::setRedirect |
FormState::setRedirectUrl | public | function | Sets the redirect URL for the form. Overrides FormStateInterface::setRedirectUrl |
FormState::setRequestMethod | public | function | Sets the HTTP method used by the request that is building the form. Overrides FormStateInterface::setRequestMethod |
FormState::setResponse | public | function | Sets a response for this form. Overrides FormStateInterface::setResponse |
FormState::setStorage | public | function | Sets the entire set of arbitrary data. Overrides FormStateInterface::setStorage |
FormState::setSubmitHandlers | public | function | Sets the submit handlers. Overrides FormStateInterface::setSubmitHandlers |
FormState::setSubmitted | public | function | Sets that the form has been submitted. Overrides FormStateInterface::setSubmitted |
FormState::setTemporary | public | function | Sets temporary data. Overrides FormStateInterface::setTemporary |
FormState::setTemporaryValue | public | function | Sets an arbitrary value in temporary storage. Overrides FormStateInterface::setTemporaryValue |
FormState::setTriggeringElement | public | function | Sets the form element that triggered submission. Overrides FormStateInterface::setTriggeringElement |
FormState::setUserInput | public | function | Sets the form values as though they were submitted by a user. Overrides FormStateInterface::setUserInput |
FormState::setValidateHandlers | public | function | Sets the validate handlers. Overrides FormStateInterface::setValidateHandlers |
FormState::setValidationComplete | public | function | Sets that validation has been completed. Overrides FormStateInterface::setValidationComplete |
FormState::setValidationEnforced | public | function | Enforces that validation is run. Overrides FormStateInterface::setValidationEnforced |
FormStateValuesTrait::getValue | public | function | Implements \Drupal\Core\Form\FormStateInterface::getValue() |
FormStateValuesTrait::hasValue | public | function | Implements \Drupal\Core\Form\FormStateInterface::hasValue() |
FormStateValuesTrait::isValueEmpty | public | function | Implements \Drupal\Core\Form\FormStateInterface::isValueEmpty() |
FormStateValuesTrait::setValue | public | function | Implements \Drupal\Core\Form\FormStateInterface::setValue() |
FormStateValuesTrait::setValueForElement | public | function | Implements \Drupal\Core\Form\FormStateInterface::setValueForElement() |
FormStateValuesTrait::setValues | public | function | Implements \Drupal\Core\Form\FormStateInterface::setValues() |
FormStateValuesTrait::unsetValue | public | function | Implements \Drupal\Core\Form\FormStateInterface::unsetValue() |
Please login to continue.