You are here

public function MetaPositionConfig::submitForm in Meta position 8

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

src/Form/MetaPositionConfig.php, line 60

Class

MetaPositionConfig
Config form settings for meta_position module.

Namespace

Drupal\meta_position\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $config = $this
    ->config('meta_position.settings');
  $config
    ->set('node_types', array_filter($form_state
    ->getValue('node_types')));
  $config
    ->set('enabled', $form_state
    ->getValue('enabled'));
  $config
    ->save();
}