You are here

public function VarnishPurgerFormBase::buildFormHeadersAdd in Varnish purger 8

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

Build the 'headers' section of the form: increments the item count.

Parameters

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

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

File

src/Form/VarnishPurgerFormBase.php, line 272

Class

VarnishPurgerFormBase
Abstract form base for Varnish based configurable purgers.

Namespace

Drupal\varnish_purger\Form

Code

public function buildFormHeadersAdd(array &$form, FormStateInterface $form_state) {
  $count = $form_state
    ->get('headers_items_count');
  $count++;
  $form_state
    ->set('headers_items_count', $count);
  $form_state
    ->setRebuild();
}