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