W3cubDocs

/Drupal 8

class FormBuilder

Provides form building and processing.

Hierarchy

Related topics

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

File

core/lib/Drupal/Core/Form/FormBuilder.php, line 28

Namespace

Drupal\Core\Form

Members

Name Modifiers Type Description
FormBuilder::$classResolver protected property The class resolver.
FormBuilder::$csrfToken protected property The CSRF token generator to validate the form token.
FormBuilder::$currentUser protected property The current user.
FormBuilder::$elementInfo protected property The element info manager.
FormBuilder::$eventDispatcher protected property The event dispatcher.
FormBuilder::$formCache protected property The form cache.
FormBuilder::$formSubmitter protected property
FormBuilder::$formValidator protected property
FormBuilder::$moduleHandler protected property The module handler.
FormBuilder::$requestStack protected property The request stack.
FormBuilder::$safeCoreValueCallables protected property Defines element value callables which are safe to run even when the form state has an invalid CSRF token.
FormBuilder::$themeManager protected property The theme manager.
FormBuilder::buildForm public function Builds and processes a form for a given form ID. Overrides FormBuilderInterface::buildForm
FormBuilder::buildFormAction protected function Builds the $form['#action'].
FormBuilder::buttonWasClicked protected function Determines if a given button triggered the form submission.
FormBuilder::currentUser protected function Gets the current active user.
FormBuilder::deleteCache public function Deletes a form in the cache. Overrides FormCacheInterface::deleteCache
FormBuilder::doBuildForm public function Builds and processes all elements in the structured form array. Overrides FormBuilderInterface::doBuildForm
FormBuilder::doSubmitForm public function Handles the submitted form, executing callbacks and processing responses. Overrides FormSubmitterInterface::doSubmitForm
FormBuilder::elementTriggeredScriptedSubmission protected function Detects if an element triggered the form submission via Ajax.
FormBuilder::executeSubmitHandlers public function Executes custom submission handlers for a given form. Overrides FormSubmitterInterface::executeSubmitHandlers
FormBuilder::executeValidateHandlers public function Executes custom validation handlers for a given form. Overrides FormValidatorInterface::executeValidateHandlers
FormBuilder::getCache public function Fetches a form from the cache. Overrides FormCacheInterface::getCache
FormBuilder::getFileUploadMaxSize protected function Wraps file_upload_max_size().
FormBuilder::getForm public function Gets a renderable form array. Overrides FormBuilderInterface::getForm
FormBuilder::getFormId public function Determines the ID of a form. Overrides FormBuilderInterface::getFormId
FormBuilder::handleInputElement protected function Adds the #name and #value properties of an input element before rendering.
FormBuilder::prepareForm public function Prepares a structured form array. Overrides FormBuilderInterface::prepareForm
FormBuilder::processForm public function Processes a form submission. Overrides FormBuilderInterface::processForm
FormBuilder::rebuildForm public function Constructs a new $form from the information in $form_state. Overrides FormBuilderInterface::rebuildForm
FormBuilder::redirectForm public function Redirects the user to a URL after a form has been processed. Overrides FormSubmitterInterface::redirectForm
FormBuilder::renderFormTokenPlaceholder public function #lazy_builder callback; renders form CSRF token.
FormBuilder::renderPlaceholderFormAction public function #lazy_builder callback; renders a form action URL.
FormBuilder::retrieveForm public function Retrieves the structured array that defines a given form. Overrides FormBuilderInterface::retrieveForm
FormBuilder::setCache public function Stores a form in the cache. Overrides FormCacheInterface::setCache
FormBuilder::setInvalidTokenError public function Sets a form_token error on the given form state. Overrides FormValidatorInterface::setInvalidTokenError
FormBuilder::submitForm public function Retrieves, populates, and processes a form. Overrides FormBuilderInterface::submitForm
FormBuilder::validateForm public function Validates user-submitted form data in the $form_state. Overrides FormValidatorInterface::validateForm
FormBuilder::valueCallableIsSafe protected function Helper function to normalize the different callable formats.
FormBuilder::__construct public function Constructs a new FormBuilder.
FormBuilderInterface::AJAX_FORM_REQUEST constant Request key for AJAX forms that submit to the form's original route.

© 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!FormBuilder.php/class/FormBuilder/8.1.x