You are here

public function TextField::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 TextBase::prepare

1 call to TextField::prepare()
YamlFormAutocomplete::prepare in src/Plugin/YamlFormElement/YamlFormAutocomplete.php
Prepare an element to be rendered within a form.
1 method overrides TextField::prepare()
YamlFormAutocomplete::prepare in src/Plugin/YamlFormElement/YamlFormAutocomplete.php
Prepare an element to be rendered within a form.

File

src/Plugin/YamlFormElement/TextField.php, line 36

Class

TextField
Provides a 'textfield' element.

Namespace

Drupal\yamlform\Plugin\YamlFormElement

Code

public function prepare(array &$element, YamlFormSubmissionInterface $yamlform_submission) {
  parent::prepare($element, $yamlform_submission);
  $element['#maxlength'] = !isset($element['#maxlength']) ? 255 : $element['#maxlength'];
}