FormStateInterface

Provides an interface for an object containing the current state of a form.

This is passed to all form related code so that the caller can use it to examine what in the form changed when the form submission process is complete. Furthermore, it may be used to store information related to the processed data in the form, which will persist across page requests when the 'cache' or 'rebuild' flag is set. See \Drupal\Core\Form\FormState::$internalStorage for documentation of the available flags.

Hierarchy

See also

\Drupal\Core\Form\FormBuilderInterface

\Drupal\Core\Form\FormValidatorInterface

\Drupal\Core\Form\FormSubmitterInterface

Related topics

Form generation
Describes how to generate and manipulate forms and process form submissions.

File

core/lib/Drupal/Core/Form/FormStateInterface.php, line 24

Namespace

Drupal\Core\Form

Members

Name Modifiers Type Description
FormStateInterface::addBuildInfo public function Adds a value to the build info.
FormStateInterface::addCleanValueKey public function Adds a key to the array of form values that will be cleaned.
FormStateInterface::addRebuildInfo public function Adds a value to the rebuild info.
FormStateInterface::cleanValues public function Removes internal Form API elements and buttons from submitted form values.
FormStateInterface::clearErrors public function Clears all errors against all form elements made by self::setErrorByName().
FormStateInterface::disableCache public function Prevents the form from being cached.
FormStateInterface::disableRedirect public function Prevents the form from redirecting.
FormStateInterface::get public function Gets any arbitrary property.
FormStateInterface::getAlwaysProcess public function Determines if this form should always be processed.
FormStateInterface::getBuildInfo public function Returns the build info for the form.
FormStateInterface::getButtons public function Returns the submit and button elements for the form.
FormStateInterface::getCacheableArray public function Returns an array representation of the cacheable portion of the form state.
FormStateInterface::getCleanValueKeys public function Gets the keys of the form values that will be cleaned.
FormStateInterface::getCompleteForm public function Returns a reference to the complete form array.
FormStateInterface::getError public function Returns the error message filed against the given form element.
FormStateInterface::getErrors public function Returns an associative array of all errors.
FormStateInterface::getFormObject public function Returns the form object that is responsible for building this form.
FormStateInterface::getGroups public function Returns references to details elements to render them within vertical tabs.
FormStateInterface::getLimitValidationErrors public function Retrieves the limited validation error sections.
FormStateInterface::getRebuildInfo public function Gets the rebuild info.
FormStateInterface::getRedirect public function Gets the value to use for redirecting after the form has been executed.
FormStateInterface::getResponse public function Gets a response for this form.
FormStateInterface::getStorage public function Returns the entire set of arbitrary data.
FormStateInterface::getSubmitHandlers public function Gets the submit handlers.
FormStateInterface::getTemporary public function Gets temporary data.
FormStateInterface::getTemporaryValue public function Gets an arbitrary value from temporary storage.
FormStateInterface::getTriggeringElement public function Gets the form element that triggered submission.
FormStateInterface::getUserInput public function Returns the form values as they were submitted by the user.
FormStateInterface::getValidateHandlers public function Gets the validate handlers.
FormStateInterface::getValue public function Returns the submitted form value for a specific key.
FormStateInterface::getValues public function Returns the submitted and sanitized form values.
FormStateInterface::has public function Determines if an arbitrary property is present.
FormStateInterface::hasAnyErrors public static function Determines if any forms have any errors.
FormStateInterface::hasFileElement public function Returns whether this form has a file element.
FormStateInterface::hasInvalidToken public function Determines if the form has an invalid token.
FormStateInterface::hasTemporaryValue public function Determines if a temporary value is present.
FormStateInterface::hasValue public function Determines if a specific key is present in the submitted form values.
FormStateInterface::isBypassingProgrammedAccessChecks public function Determines if this form submission should bypass #access.
FormStateInterface::isCached public function Determines if the form should be cached.
FormStateInterface::isExecuted public function Determines if the form was submitted and has been processed and executed.
FormStateInterface::isMethodType public function Returns the HTTP form method.
FormStateInterface::isProcessingInput public function Determines if the form input will be processed.
FormStateInterface::isProgrammed public function Returns if this form was submitted programmatically.
FormStateInterface::isRebuilding public function Determines if the form should be rebuilt after processing.
FormStateInterface::isRedirectDisabled public function Determines if redirecting has been prevented.
FormStateInterface::isSubmitted public function Determines if the form has been submitted.
FormStateInterface::isValidationComplete public function Determines if validation has been completed.
FormStateInterface::isValidationEnforced public function Checks if validation is enforced.
FormStateInterface::isValueEmpty public function Determines if a specific key has a value in the submitted form values.
FormStateInterface::loadInclude public function Ensures an include file is loaded whenever the form is processed.
FormStateInterface::prepareCallback public function Converts support notations for a form callback to a valid callable.
FormStateInterface::set public function Sets a value to an arbitrary property.
FormStateInterface::setAlwaysProcess public function Sets this form to always be processed.
FormStateInterface::setBuildInfo public function Sets the build info for the form.
FormStateInterface::setButtons public function Stores the submit and button elements for the form.
FormStateInterface::setCached public function Sets this form to be cached.
FormStateInterface::setCleanValueKeys public function Sets the keys of the form values that will be cleaned.
FormStateInterface::setCompleteForm public function Stores the complete form array.
FormStateInterface::setError public function Flags an element as having an error.
FormStateInterface::setErrorByName public function Files an error against a form element.
FormStateInterface::setExecuted public function Sets that the form was submitted and has been processed and executed.
FormStateInterface::setFormObject public function Sets the form object that is responsible for building this form.
FormStateInterface::setFormState public function Sets the value of the form state.
FormStateInterface::setGroups public function Sets references to details elements to render them within vertical tabs.
FormStateInterface::setHasFileElement public function Sets that this form has a file element.
FormStateInterface::setInvalidToken public function Flags the form state as having or not an invalid token.
FormStateInterface::setLimitValidationErrors public function Sets the limited validation error sections.
FormStateInterface::setMethod public function Sets the HTTP method to use for the form's submission.
FormStateInterface::setProcessInput public function Sets that the form should process input.
FormStateInterface::setProgrammed public function Sets that this form was submitted programmatically.
FormStateInterface::setProgrammedBypassAccessCheck public function Sets if this form submission should bypass #access.
FormStateInterface::setRebuild public function Sets the form to be rebuilt after processing.
FormStateInterface::setRebuildInfo public function Sets the rebuild info.
FormStateInterface::setRedirect public function Sets the redirect for the form.
FormStateInterface::setRedirectUrl public function Sets the redirect URL for the form.
FormStateInterface::setRequestMethod public function Sets the HTTP method used by the request that is building the form.
FormStateInterface::setResponse public function Sets a response for this form.
FormStateInterface::setStorage public function Sets the entire set of arbitrary data.
FormStateInterface::setSubmitHandlers public function Sets the submit handlers.
FormStateInterface::setSubmitted public function Sets that the form has been submitted.
FormStateInterface::setTemporary public function Sets temporary data.
FormStateInterface::setTemporaryValue public function Sets an arbitrary value in temporary storage.
FormStateInterface::setTriggeringElement public function Sets the form element that triggered submission.
FormStateInterface::setUserInput public function Sets the form values as though they were submitted by a user.
FormStateInterface::setValidateHandlers public function Sets the validate handlers.
FormStateInterface::setValidationComplete public function Sets that validation has been completed.
FormStateInterface::setValidationEnforced public function Enforces that validation is run.
FormStateInterface::setValue public function Sets the submitted form value for a specific key.
FormStateInterface::setValueForElement public function Changes submitted form values during form validation.
FormStateInterface::setValues public function Sets the submitted form values.
FormStateInterface::unsetValue public function Removes a specific key from the submitted form values.
doc_Drupal
2016-10-29 09:16:31
Comments
Leave a Comment

Please login to continue.