You are here

public function StickyConfigurationForm::submitForm in Sticky 8

Same name and namespace in other branches
  1. 2.0.x src/Form/StickyConfigurationForm.php \Drupal\sticky\Form\StickyConfigurationForm::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

src/Form/StickyConfigurationForm.php, line 124

Class

StickyConfigurationForm
This class creates the Sticky configuration form.

Namespace

Drupal\sticky\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();
  $this
    ->config('sticky.settings')
    ->set('selector', $values['selector'])
    ->set('top_spacing', $values['top_spacing'])
    ->set('bottom_spacing', $values['bottom_spacing'])
    ->set('class_name', $values['class_name'])
    ->set('wrapper_class_name', $values['wrapper_class_name'])
    ->set('center', $values['center'])
    ->set('get_width_from', $values['get_width_from'])
    ->set('width_from_wrapper', $values['width_from_wrapper'])
    ->set('responsive_width', $values['responsive_width'])
    ->set('z_index', $values['z_index'])
    ->save();
  parent::submitForm($form, $form_state);
}