You are here

public function YamlForm::invokeElements in YAML Form 8

Invoke elements method.

Parameters

string $method: The handle method to be invoked.

mixed $data: The argument to passed by reference to the handler method.

Overrides YamlFormInterface::invokeElements

File

src/Entity/YamlForm.php, line 1382

Class

YamlForm
Defines the form entity.

Namespace

Drupal\yamlform\Entity

Code

public function invokeElements($method, &$data, &$context1 = NULL, &$context2 = NULL) {

  /** @var \Drupal\yamlform\YamlFormElementManagerInterface $element_manager */
  $element_manager = \Drupal::service('plugin.manager.yamlform.element');
  $elements = $this
    ->getElementsInitializedAndFlattened();
  foreach ($elements as $element) {
    $element_manager
      ->invokeMethod($method, $element, $data, $context1, $context2);
  }
}