public function SettingsForm::submitForm in Build Hooks 3.x
Same name in this branch
- 3.x src/Form/SettingsForm.php \Drupal\build_hooks\Form\SettingsForm::submitForm()
- 3.x modules/build_hooks_bitbucket/src/Form/SettingsForm.php \Drupal\build_hooks_bitbucket\Form\SettingsForm::submitForm()
Same name and namespace in other branches
- 8.2 modules/build_hooks_bitbucket/src/Form/SettingsForm.php \Drupal\build_hooks_bitbucket\Form\SettingsForm::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
- modules/
build_hooks_bitbucket/ src/ Form/ SettingsForm.php, line 68
Class
- SettingsForm
- Configure build_hooks_bitbucket settings for this site.
Namespace
Drupal\build_hooks_bitbucket\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this
->config('build_hooks_bitbucket.settings');
$config
->set('username', $form_state
->getValue('username'));
if (!empty($form_state
->getValue('password'))) {
$config
->set('password', $form_state
->getValue('password'));
}
$config
->save();
parent::submitForm($form, $form_state);
}