Drupal 8  8.0.2
FormSubmitter Class Reference
Inheritance diagram for FormSubmitter:

Public Member Functions

 __construct (RequestStack $request_stack, UrlGeneratorInterface $url_generator)
 
 doSubmitForm (&$form, FormStateInterface &$form_state)
 
 executeSubmitHandlers (&$form, FormStateInterface &$form_state)
 
 redirectForm (FormStateInterface $form_state)
 

Protected Member Functions

 drupalInstallationAttempted ()
 
batchGet ()
 

Protected Attributes

 $urlGenerator
 
 $requestStack
 

Detailed Description

Provides submission processing for forms.

Constructor & Destructor Documentation

__construct ( RequestStack  $request_stack,
UrlGeneratorInterface  $url_generator 
)

Constructs a new FormValidator.

Parameters
\Symfony\Component\HttpFoundation\RequestStack$request_stackThe request stack.
\Drupal\Core\Routing\UrlGeneratorInterface$url_generator

References Drupal\requestStack(), and Drupal\urlGenerator().

Here is the call graph for this function:

Member Function Documentation

& batchGet ( )
protected

Wraps batch_get().

References batch_get().

Referenced by FormSubmitter\doSubmitForm(), and FormSubmitter\executeSubmitHandlers().

Here is the call graph for this function:

Here is the caller graph for this function:

doSubmitForm ( $form,
FormStateInterface $form_state 
)

{Handles the submitted form, executing callbacks and processing responses.

Parameters
array$formAn associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.
Returns
null| If a response was set by a submit handler, or if the form needs to redirect, a Response object will be returned.
}

Implements FormSubmitterInterface.

References FormSubmitter\batchGet(), FormSubmitter\executeSubmitHandlers(), FormStateInterface\getResponse(), FormStateInterface\isProgrammed(), FormStateInterface\isSubmitted(), FormSubmitter\redirectForm(), FormStateInterface\setExecuted(), and FormStateInterface\setResponse().

Here is the call graph for this function:

drupalInstallationAttempted ( )
protected

Wraps drupal_installation_attempted().

Returns
bool
executeSubmitHandlers ( $form,
FormStateInterface $form_state 
)

{Executes custom submission handlers for a given form.Button-specific handlers are checked first. If none exist, the function falls back to form-level handlers.

Parameters
$formAn associative array containing the structure of the form.
$form_stateThe current state of the form. If the user submitted the form by clicking a button with custom handler functions defined, those handlers will be stored here.
}

Implements FormSubmitterInterface.

References FormSubmitter\batchGet(), FormStateInterface\getSubmitHandlers(), and FormStateInterface\prepareCallback().

Referenced by FormSubmitter\doSubmitForm().

Here is the call graph for this function:

Here is the caller graph for this function:

redirectForm ( FormStateInterface  $form_state)

{Redirects the user to a URL after a form has been processed.After a form is submitted and processed, normally the user should be redirected to a new destination page. This function figures out what that destination should be, based on the $form_state and the 'destination' query string in the request URL, and redirects the user there.The result of |FormStateInterface::getRedirect() determines where to redirect the user. See the possible return values listed there. If the result is FALSE, then the user will not be redirected.Here is an example of how to set up a form to redirect to the path 'user':

$form_state->setRedirect('user.page');

And here is an example of how to redirect to 'node/123?foo=bar::baz':

$form_state->setRedirect('entity.node.canonical',
array('node' => 123),
array(
'query' => array(
'foo' => 'bar',
),
'fragment' => 'baz',
),
));
Parameters
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.
Returns
|null
See Also
::processForm()
::buildForm()
}

Implements FormSubmitterInterface.

References FormStateInterface\getRedirect(), Drupal\requestStack(), and Drupal\urlGenerator().

Referenced by FormSubmitter\doSubmitForm().

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: