You are here

public function BettrLoginConfigForm::submitForm in Better Login Form Configuration 8.2

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/BettrLoginConfigForm.php, line 229

Class

BettrLoginConfigForm
Form controller for BettrLogin forms.

Namespace

Drupal\better_login_form_config\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('better_login_form_config.settings');
  $config
    ->set('form_title', $form_state
    ->getValue('form_title'));
  $config
    ->set('form_tab', $form_state
    ->getValue('form_tab'));
  $config
    ->set('username_label', $form_state
    ->getValue('username_label'));
  $config
    ->set('username_description', $form_state
    ->getValue('username_description'));
  $config
    ->set('password_label', $form_state
    ->getValue('password_label'));
  $config
    ->set('password_description', $form_state
    ->getValue('password_description'));
  $config
    ->set('login_button', $form_state
    ->getValue('login_button'));
  $config
    ->set('login_page_link', $form_state
    ->getValue('login_page_link'));
  $config
    ->set('create_account', $form_state
    ->getValue('create_account'));
  $config
    ->set('forgot_password', $form_state
    ->getValue('forgot_password'));
  $config
    ->set('back_to_home', $form_state
    ->getValue('back_to_home'));
  $config
    ->set('forgot_form_title', $form_state
    ->getValue('forgot_form_title'));
  $config
    ->set('forgot_form_tab', $form_state
    ->getValue('forgot_form_tab'));
  $config
    ->set('register_form_title', $form_state
    ->getValue('register_form_title'));
  $config
    ->set('register_form_tab', $form_state
    ->getValue('register_form_tab'));
  $config
    ->set('register_form_mail', $form_state
    ->getValue('register_form_mail'));
  $config
    ->set('register_mail_desc', $form_state
    ->getValue('register_mail_desc'));
  $config
    ->set('register_form_name', $form_state
    ->getValue('register_form_name'));
  $config
    ->set('register_form_name_desc', $form_state
    ->getValue('register_form_name_desc'));
  $config
    ->set('register_form_button', $form_state
    ->getValue('register_form_button'));
  $config
    ->set('forgot_form_username_desc', $form_state
    ->getValue('forgot_form_username_desc'));
  $config
    ->set('forgot_form_username', $form_state
    ->getValue('forgot_form_username'));
  $config
    ->set('forgot_form_button', $form_state
    ->getValue('forgot_form_button'));
  $config
    ->set('include_login', $form_state
    ->getValue('include_login'));
  $config
    ->set('include_regi_template', $form_state
    ->getValue('include_regi_template'));
  $config
    ->set('include_forgot_template', $form_state
    ->getValue('include_forgot_template'));
  $config
    ->save();
  return parent::submitForm($form, $form_state);
}