You are here

public function YamlFormMultiple::getInfo in YAML Form 8

Returns the element properties for this element.

Return value

array An array of element properties. See \Drupal\Core\Render\ElementInfoManagerInterface::getInfo() for documentation of the standard properties of all elements, and the return value format.

Overrides ElementInterface::getInfo

File

src/Element/YamlFormMultiple.php, line 21

Class

YamlFormMultiple
Provides a form element to assist in creation of multiple elements.

Namespace

Drupal\yamlform\Element

Code

public function getInfo() {
  $class = get_class($this);
  return [
    '#input' => TRUE,
    '#label' => t('item'),
    '#labels' => t('items'),
    '#header' => NULL,
    '#element' => [
      '#type' => 'textfield',
      '#title' => t('Item value'),
      '#title_display' => 'invisible',
      '#placeholder' => t('Enter value'),
    ],
    '#cardinality' => FALSE,
    '#empty_items' => 1,
    '#add_more' => 1,
    '#process' => [
      [
        $class,
        'processYamlFormMultiple',
      ],
    ],
    '#theme_wrappers' => [
      'form_element',
    ],
  ];
}