You are here

public function YamlFormTest::prepare in YAML Form 8

Prepare an element to be rendered within a form.

Parameters

array $element: An element.

\Drupal\yamlform\YamlFormSubmissionInterface $yamlform_submission: A form submission.

Overrides YamlFormElementBase::prepare

File

tests/modules/yamlform_test/src/Plugin/YamlFormElement/YamlFormTest.php, line 23

Class

YamlFormTest
Provides a 'yamlform_test' element.

Namespace

Drupal\yamlform_test\Plugin\YamlFormElement

Code

public function prepare(array &$element, YamlFormSubmissionInterface $yamlform_submission) {
  $this
    ->displayMessage(__FUNCTION__);
  $element['#element_validate'][] = [
    get_class($this),
    'validate',
  ];
}