You are here

public static function Linkit::preRenderLinkitElement in Linkit 8.4

Same name and namespace in other branches
  1. 8.5 src/Element/Linkit.php \Drupal\linkit\Element\Linkit::preRenderLinkitElement()

Prepares a #type 'linkit' render element for input.html.twig.

Parameters

array $element: An associative array containing the properties of the element. Properties used: #title, #value, #description, #size, #attributes.

Return value

array The $element with prepared variables ready for input.html.twig.

File

src/Element/Linkit.php, line 100
Contains \Drupal\linkit\Element\Linkit.

Class

Linkit
Provides a form element for linkit.

Namespace

Drupal\linkit\Element

Code

public static function preRenderLinkitElement($element) {
  $element['#attributes']['type'] = 'text';
  Element::setAttributes($element, array(
    'id',
    'name',
    'value',
    'size',
  ));
  static::setAttributes($element, array(
    'form-text',
  ));
  return $element;
}