You are here

public function JQueryColorpicker::getInfo in Jquery Colorpicker 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/JQueryColorpicker.php, line 20

Class

JQueryColorpicker
Provides a jQuery colorpicker form element.

Namespace

Drupal\jquery_colorpicker\Element

Code

public function getInfo() {
  $class = get_class($this);
  return [
    '#input' => TRUE,
    '#maxlength' => 7,
    '#size' => 7,
    '#element_validate' => [
      [
        $class,
        'validateElement',
      ],
    ],
    '#jquery_colorpicker_background' => 'select.png',
    '#pre_render' => [
      [
        $class,
        'preRenderjQueryColorpicker',
      ],
    ],
    '#process' => [
      'Drupal\\Core\\Render\\Element\\RenderElement::processAjaxForm',
      [
        $class,
        'processElement',
      ],
    ],
    '#theme' => 'jquery_colorpicker',
    '#theme_wrappers' => [
      'form_element',
    ],
    '#attached' => [
      'library' => [
        'jquery_colorpicker/element',
      ],
    ],
  ];
}