You are here

public function HttpPurgerFormBase::buildFormSuccessResolution in Generic HTTP Purger 8

Build the 'success resolution' section of the form.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

\Drupal\purge_purger_http\Entity\HttpPurgerSettings $settings: Configuration entity for the purger being configured.

1 call to HttpPurgerFormBase::buildFormSuccessResolution()
HttpPurgerFormBase::buildForm in src/Form/HttpPurgerFormBase.php
Form constructor.

File

src/Form/HttpPurgerFormBase.php, line 502

Class

HttpPurgerFormBase
Abstract form base for HTTP based configurable purgers.

Namespace

Drupal\purge_purger_http\Form

Code

public function buildFormSuccessResolution(array &$form, FormStateInterface $form_state, HttpPurgerSettings $settings) {
  $form['sr'] = [
    '#type' => 'details',
    '#group' => 'tabs',
    '#title' => $this
      ->t('Success resolution'),
  ];
  $form['sr']['http_errors'] = [
    '#title' => $this
      ->t('Treat 4XX and 5XX responses as a failed invalidation.'),
    '#type' => 'checkbox',
    '#default_value' => $settings->http_errors,
  ];
}