public static function ImageBrowser::preRenderField in Image Entity Browser 8
Prepares a #type 'image_browser' render element for input.html.twig.
Parameters
array $element: An associative array containing the properties of the element. Properties used: #title, #value, #description, #attributes.
Return value
array The $element with prepared variables ready for input.html.twig.
File
- src/
Element/ ImageBrowser.php, line 55
Class
- ImageBrowser
- Provides a form element for choosing a color.
Namespace
Drupal\image_browser\ElementCode
public static function preRenderField($element) {
$element['#attributes']['type'] = 'hidden';
$element['#attached']['library'][] = 'image_browser/image_browser';
Element::setAttributes($element, array(
'id',
'name',
'value',
));
static::setAttributes($element, array(
'form-image-browser',
));
return $element;
}