You are here

public function YamlForm::getElement in YAML Form 8

Get a form's initialized element.

Parameters

string $key: The element's key.

Return value

array|null An associative array containing an initialized element.

Overrides YamlFormInterface::getElement

File

src/Entity/YamlForm.php, line 919

Class

YamlForm
Defines the form entity.

Namespace

Drupal\yamlform\Entity

Code

public function getElement($key) {
  $elements_flattened = $this
    ->getElementsInitializedAndFlattened();
  return isset($elements_flattened[$key]) ? $elements_flattened[$key] : NULL;
}