You are here

public function SubformState::addElementState in Markdown 8.2

Adds a #states selector to an element.

Parameters

array $element: An element to add the state to, passed by reference.

string $state: The state that will be triggered.

string $name: The name of the element used for conditions.

array $conditions: The conditions of $name that trigger $state.

array $parents: Optional. A specific array of parents. If not provided, the parents are determined automatically by the subform state.

Overrides SubformStateInterface::addElementState

1 call to SubformState::addElementState()
SubformState::conditionalElement in src/Form/SubformState.php
{@inheritdoc

File

src/Form/SubformState.php, line 68

Class

SubformState
Markdown subform state.

Namespace

Drupal\markdown\Form

Code

public function addElementState(array &$element, $state, $name, array $conditions, array $parents = NULL) {
  if (!isset($parents)) {
    $parents = $this
      ->getAllParents();
  }
  static::traitAddElementState($element, $state, $name, $conditions, $parents);
}