You are here

public function NumericBase::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

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

File

src/Plugin/YamlFormElement/NumericBase.php, line 29

Class

NumericBase
Provides a base 'numeric' class.

Namespace

Drupal\yamlform\Plugin\YamlFormElement

Code

public function prepare(array &$element, YamlFormSubmissionInterface $yamlform_submission) {
  parent::prepare($element, $yamlform_submission);
  if ($this
    ->hasProperty('step') && !isset($element['#step'])) {
    $element['#step'] = 'any';
  }
}