Skip to content
SessionTestForm.php 981 B
Newer Older
<?php

namespace Drupal\session_test\Form;

use Drupal\Component\Utility\SafeMarkup;

/**
 * Form controller for the test config edit forms.
 */
class SessionTestForm extends FormBase {

  /**
   * {@inheritdoc}
   */
    return 'session_test_form';
  }

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
      '#type' => 'textfield',
      '#title' => 'Input',
      '#required' => TRUE,
    $form['actions'] = ['#type' => 'actions'];
    $form['actions']['submit'] = [
      '#type' => 'submit',
      '#value' => 'Save',
  public function submitForm(array &$form, FormStateInterface $form_state) {
    drupal_set_message(SafeMarkup::format('Ok: @input', ['@input' => $form_state->getValue('input')]));