You are here

public function ContainerTrait::statesArray in GoogleTagManager 8

Returns states array for a form element.

Parameters

string $variable: The name of the form element.

Return value

array The states array.

1 call to ContainerTrait::statesArray()
ContainerTrait::advancedFieldset in src/Form/ContainerTrait.php
Fieldset builder for the container settings form.

File

src/Form/ContainerTrait.php, line 118

Class

ContainerTrait
Defines shared routines for the container and settings forms.

Namespace

Drupal\google_tag\Form

Code

public function statesArray($variable) {
  return [
    'required' => [
      ':input[name="' . $variable . '"]' => [
        'checked' => TRUE,
      ],
    ],
    'invisible' => [
      ':input[name="' . $variable . '"]' => [
        'checked' => FALSE,
      ],
    ],
  ];
}