public function WebformMapping::preview in Webform 8.5
Same name and namespace in other branches
- 6.x src/Plugin/WebformElement/WebformMapping.php \Drupal\webform\Plugin\WebformElement\WebformMapping::preview()
Generate a renderable preview of the element.
Return value
array A renderable preview of the element.
Overrides WebformElementBase::preview
File
- src/Plugin/ WebformElement/ WebformMapping.php, line 226 
Class
- WebformMapping
- Provides a 'mapping' element.
Namespace
Drupal\webform\Plugin\WebformElementCode
public function preview() {
  return parent::preview() + [
    '#source' => [
      'one' => $this
        ->t('One'),
      'two' => $this
        ->t('Two'),
      'three' => $this
        ->t('Three'),
    ],
    '#destination' => [
      'four' => $this
        ->t('Four'),
      'five' => $this
        ->t('Five'),
      'six' => $this
        ->t('Six'),
    ],
  ];
}