You are here

protected function WebformToggle::defineDefaultProperties in Webform 8.5

Same name and namespace in other branches
  1. 6.x modules/webform_toggles/src/Plugin/WebformElement/WebformToggle.php \Drupal\webform_toggles\Plugin\WebformElement\WebformToggle::defineDefaultProperties()

Define an element's default properties.

Return value

array An associative array contain an the element's default properties.

Overrides Checkbox::defineDefaultProperties

File

modules/webform_toggles/src/Plugin/WebformElement/WebformToggle.php, line 27

Class

WebformToggle
Provides a 'toggle' element.

Namespace

Drupal\webform_toggles\Plugin\WebformElement

Code

protected function defineDefaultProperties() {
  $properties = [
    'toggle_theme' => 'light',
    'toggle_size' => 'medium',
    'on_text' => '',
    'off_text' => '',
    'title_display' => 'after',
  ] + parent::defineDefaultProperties();
  unset($properties['required']);
  return $properties;
}