You are here

public function OptionsBase::getDefaultProperties in YAML Form 8

Only a few elements don't inherit these default properties.

Overrides YamlFormElementBase::getDefaultProperties

See also

\Drupal\yamlform\Plugin\YamlFormElement\Textarea

\Drupal\yamlform\Plugin\YamlFormElement\YamlFormLikert

\Drupal\yamlform\Plugin\YamlFormElement\YamlFormCompositeBase

\Drupal\yamlform\Plugin\YamlFormElement\ContainerBase

8 calls to OptionsBase::getDefaultProperties()
Checkboxes::getDefaultProperties in src/Plugin/YamlFormElement/Checkboxes.php
Only a few elements don't inherit these default properties.
Radios::getDefaultProperties in src/Plugin/YamlFormElement/Radios.php
Only a few elements don't inherit these default properties.
Select::getDefaultProperties in src/Plugin/YamlFormElement/Select.php
Only a few elements don't inherit these default properties.
TableSelect::getDefaultProperties in src/Plugin/YamlFormElement/TableSelect.php
Only a few elements don't inherit these default properties.
YamlFormButtonsOther::getDefaultProperties in src/Plugin/YamlFormElement/YamlFormButtonsOther.php
Only a few elements don't inherit these default properties.

... See full list

8 methods override OptionsBase::getDefaultProperties()
Checkboxes::getDefaultProperties in src/Plugin/YamlFormElement/Checkboxes.php
Only a few elements don't inherit these default properties.
Radios::getDefaultProperties in src/Plugin/YamlFormElement/Radios.php
Only a few elements don't inherit these default properties.
Select::getDefaultProperties in src/Plugin/YamlFormElement/Select.php
Only a few elements don't inherit these default properties.
TableSelect::getDefaultProperties in src/Plugin/YamlFormElement/TableSelect.php
Only a few elements don't inherit these default properties.
YamlFormButtonsOther::getDefaultProperties in src/Plugin/YamlFormElement/YamlFormButtonsOther.php
Only a few elements don't inherit these default properties.

... See full list

File

src/Plugin/YamlFormElement/OptionsBase.php, line 28

Class

OptionsBase
Provides a base 'options' element.

Namespace

Drupal\yamlform\Plugin\YamlFormElement

Code

public function getDefaultProperties() {
  $default_properties = parent::getDefaultProperties();

  // Issue #2836374: Wrapper attributes are not supported by composite
  // elements, this includes radios, checkboxes, and buttons.
  if (preg_match('/(radios|checkboxes|buttons)/', $this
    ->getPluginId())) {
    unset($default_properties['wrapper_attributes']);
  }
  return $default_properties + [
    // Options settings.
    'options' => [],
    'options_randomize' => FALSE,
  ];
}