You are here

public function CheckboxTree::getInfo in Taxonomy Term Reference Tree Widget 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/CheckboxTree.php, line 21

Class

CheckboxTree
Provides a form element for term reference tree.

Namespace

Drupal\term_reference_tree\Element

Code

public function getInfo() {
  $class = get_class($this);
  return [
    '#input' => TRUE,
    '#tree' => TRUE,
    '#process' => [
      [
        $class,
        'processCheckboxTree',
      ],
    ],
    '#pre_render' => [
      [
        $class,
        'preRenderCompositeFormElement',
      ],
    ],
    '#default_value' => [],
    '#attached' => [
      'library' => [
        'term_reference_tree/term_reference_tree_js',
        'term_reference_tree/term_reference_tree_css',
      ],
    ],
    '#theme' => 'checkbox_tree',
  ];
}