You are here

public function SupportTicketForm::preview in Support Ticketing System 8

Form submission handler for the 'preview' action.

Parameters

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

$form_state: The current state of the form.

File

modules/support_ticket/src/SupportTicketForm.php, line 338
Contains \Drupal\support_ticket\SupportTicketForm.

Class

SupportTicketForm
Form controller for the support ticket edit forms.

Namespace

Drupal\support_ticket

Code

public function preview(array $form, FormStateInterface $form_state) {
  $store = $this->tempStoreFactory
    ->get('support_ticket_preview');
  $this->entity->in_preview = TRUE;
  $store
    ->set($this->entity
    ->uuid(), $form_state);
  $form_state
    ->setRedirect('entity.support_ticket.preview', array(
    'support_ticket_preview' => $this->entity
      ->uuid(),
    'view_mode_id' => 'default',
  ));
}