You are here

public function PasswordConfirm::setDefaultValue in YAML Form 8

Set an element's default value using saved data.

Parameters

array $element: An element.

Overrides YamlFormElementBase::setDefaultValue

File

src/Plugin/YamlFormElement/PasswordConfirm.php, line 41

Class

PasswordConfirm
Provides a 'password_confirm' element.

Namespace

Drupal\yamlform\Plugin\YamlFormElement

Code

public function setDefaultValue(array &$element) {
  if (isset($element['#default_value'])) {
    $element['#default_value'] = [
      'pass1' => $element['#default_value'],
      'pass2' => $element['#default_value'],
    ];
  }
}