You are here

public function EntityList::submitForm in Entity Update 8

Same name and namespace in other branches
  1. 2.0.x src/Form/EntityList.php \Drupal\entity_update\Form\EntityList::submitForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormInterface::submitForm

File

src/Form/EntityList.php, line 90

Class

EntityList
Class EntityList.

Namespace

Drupal\entity_update\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $entity_type_id = $form_state
    ->getValue('entity_type_id');
  $start = $form_state
    ->getValue('start');
  $length = $form_state
    ->getValue('length');

  // Redirect to correct page with parameters.
  if ($entity_type_id) {
    $url = Url::fromRoute('entity_update.list', [
      'entity_type_id' => $entity_type_id,
      'start' => $start,
      'length' => $length,
    ]);
    $form_state
      ->setRedirectUrl($url);
  }
}