You are here

public function VarnishPurgerFormBase::buildFormSuccessResolution in Varnish purger 8

Same name and namespace in other branches
  1. 8.2 src/Form/VarnishPurgerFormBase.php \Drupal\varnish_purger\Form\VarnishPurgerFormBase::buildFormSuccessResolution()

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\varnish_purger\Entity\VarnishPurgerSettings $settings: Configuration entity for the purger being configured.

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

File

src/Form/VarnishPurgerFormBase.php, line 426

Class

VarnishPurgerFormBase
Abstract form base for Varnish based configurable purgers.

Namespace

Drupal\varnish_purger\Form

Code

public function buildFormSuccessResolution(array &$form, FormStateInterface $form_state, VarnishPurgerSettings $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,
  ];
}