You are here

public function FormTestObject::submitForm in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/form_test/src/FormTestObject.php \Drupal\form_test\FormTestObject::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 ConfigFormBase::submitForm

File

core/modules/system/tests/modules/form_test/src/FormTestObject.php, line 64
Contains \Drupal\form_test\FormTestObject.

Class

FormTestObject
Provides a test form object.

Namespace

Drupal\form_test

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  drupal_set_message($this
    ->t('The FormTestObject::submitForm() method was used for this form.'));
  $this
    ->config('form_test.object')
    ->set('bananas', $form_state
    ->getValue('bananas'))
    ->save();
}