You are here

public function UserMenuAvatarConfigurationForm::submitForm in User Menu Avatar (User Image in Menu) 8.4

Same name and namespace in other branches
  1. 8.5 src/Form/UserMenuAvatarConfigurationForm.php \Drupal\user_menu_avatar\Form\UserMenuAvatarConfigurationForm::submitForm()
  2. 8 src/form/UserMenuAvatarConfigurationForm.php \Drupal\user_menu_avatar\Form\UserMenuAvatarConfigurationForm::submitForm()
  3. 8.2 src/form/UserMenuAvatarConfigurationForm.php \Drupal\user_menu_avatar\Form\UserMenuAvatarConfigurationForm::submitForm()
  4. 8.3 src/Form/UserMenuAvatarConfigurationForm.php \Drupal\user_menu_avatar\Form\UserMenuAvatarConfigurationForm::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/UserMenuAvatarConfigurationForm.php, line 191

Class

UserMenuAvatarConfigurationForm
Defines our form class.

Namespace

Drupal\user_menu_avatar\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();
  $this->configFactory
    ->getEditable('user_menu_avatar.user_menu_avatar_settings')
    ->set('avatar_shape', $values['avatar_shape'])
    ->set('link_text_name', $values['link_text_name'])
    ->set('avatar_size', $values['avatar_size'])
    ->set('avatar_image_field', $values['avatar_image_field'])
    ->set('show_menu_avatar', $values['show_menu_avatar'])
    ->set('show_menu_name', $values['show_menu_name'])
    ->set('avatar_custom_name_field', $values['avatar_custom_name_field'])
    ->save();
  parent::submitForm($form, $form_state);
}