You are here

public function IdpForm::addCertCallback in SAML Service Provider 3.x

Same name and namespace in other branches
  1. 8.3 src/Form/IdpForm.php \Drupal\saml_sp\Form\IdpForm::addCertCallback()
  2. 8.2 src/Form/IdpForm.php \Drupal\saml_sp\Form\IdpForm::addCertCallback()
  3. 4.x src/Form/IdpForm.php \Drupal\saml_sp\Form\IdpForm::addCertCallback()

Submit handler for the "add cert" button.

Increments the max counter and causes a rebuild.

File

src/Form/IdpForm.php, line 261

Class

IdpForm
Provides the form to configure the IdP.

Namespace

Drupal\saml_sp\Form

Code

public function addCertCallback(array &$form, FormStateInterface $form_state) {
  $cert_field = $form_state
    ->get('num_certs');
  $add_button = $cert_field + 1;
  $form_state
    ->set('num_certs', $add_button);
  $form_state
    ->setRebuild();
}