You are here

public function NumericBase::prepare in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/NumericBase.php \Drupal\webform\Plugin\WebformElement\NumericBase::prepare()

Prepare an element to be rendered within a webform.

Parameters

array $element: An element.

\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission. Webform submission is optional since it is not used by composite sub elements.

Overrides WebformElementBase::prepare

See also

\Drupal\webform\Element\WebformCompositeBase::processWebformComposite

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

File

src/Plugin/WebformElement/NumericBase.php, line 33

Class

NumericBase
Provides a base 'numeric' class.

Namespace

Drupal\webform\Plugin\WebformElement

Code

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