You are here

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

File

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

Class

YamlFormLikert
Provides a 'likert' element.

Namespace

Drupal\yamlform\Plugin\YamlFormElement

Code

public function getDefaultProperties() {
  return [
    'title' => '',
    // General settings.
    'description' => '',
    'default_value' => [],
    // Form display.
    'title_display' => '',
    'description_display' => '',
    // Form validation.
    'required' => FALSE,
    // Submission display.
    'format' => $this
      ->getDefaultFormat(),
    // Likert settings.
    'questions' => [],
    'questions_randomize' => FALSE,
    'answers' => [],
    'na_answer' => FALSE,
    'na_answer_value' => '',
    'na_answer_text' => $this
      ->t('N/A'),
  ] + $this
    ->getDefaultBaseProperties();
}