function RestExampleClientSettings::submitForm

Same name in other branches
  1. 4.0.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\Form

Code

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);
}