You are here

public function ReferencePreviewForm::submitForm in Bibliography & Citation 2.0.x

Same name and namespace in other branches
  1. 8 modules/bibcite_entity/src/Form/ReferencePreviewForm.php \Drupal\bibcite_entity\Form\ReferencePreviewForm::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

modules/bibcite_entity/src/Form/ReferencePreviewForm.php, line 121

Class

ReferencePreviewForm
Reference Preview Form.

Namespace

Drupal\bibcite_entity\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $route_parameters = [
    'bibcite_reference_preview' => $form_state
      ->getValue('uuid'),
    'view_mode_id' => $form_state
      ->getValue('view_mode'),
  ];
  $options = [];
  $query = $this
    ->getRequest()->query;
  if ($query
    ->has('destination')) {
    $options['query']['destination'] = $query
      ->get('destination');
    $query
      ->remove('destination');
  }
  $form_state
    ->setRedirect('entity.bibcite_reference.preview', $route_parameters, $options);
}