function RestExampleClientSettings::submitForm
Same name in other branches
- 3.x modules/rest_example/src/Form/RestExampleClientSettings.php \Drupal\rest_example\Form\RestExampleClientSettings::submitForm()
Overrides ConfigFormBase::submitForm
File
-
modules/
rest_example/ src/ Form/ RestExampleClientSettings.php, line 58
Class
- RestExampleClientSettings
- Setup form for a Drupal REST client.
Namespace
Drupal\rest_example\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$form_values = $form_state->getValues();
$this->config('rest_example.settings')
->set('server_url', $form_values['server_url'])
->set('server_username', $form_values['server_username'])
->set('server_password', $form_values['server_password'])
->save();
parent::submitForm($form, $form_state);
}