You are here

public function Oauth2ClientPluginConfigForm::submitForm in OAuth2 Client 8.3

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 FormInterface::submitForm

1 call to Oauth2ClientPluginConfigForm::submitForm()
Oauth2ClientPluginConfigForm::testToken in src/Form/Oauth2ClientPluginConfigForm.php
Additional submit function for saving both config and token.

File

src/Form/Oauth2ClientPluginConfigForm.php, line 113

Class

Oauth2ClientPluginConfigForm
Configure OAuth2 Client settings for this site.

Namespace

Drupal\oauth2_client\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $subformState = SubformState::createForSubform($form['plugin'], $form, $form_state);
  $this->plugin
    ->submitConfigurationForm($form['plugin'], $subformState);
  $form_state
    ->setRedirect('oauth2_client.oauth2_client_plugin_list');
  $this->messenger
    ->addStatus($this
    ->t('Configuration saved for <em>@label</em>', [
    '@label' => $this->plugin
      ->getName(),
  ]));
}