public static function Signature::preRenderSignature in Signature Field 8
File
- src/
Plugin/ Field/ Element/ Signature.php, line 41
Class
- Signature
- Plugin annotation @FormElement("signature");
Namespace
Drupal\signature_field\ElementCode
public static function preRenderSignature(array $element) {
$sign_thumb = [
'#type' => 'html_tag',
'#tag' => 'img',
'#attributes' => [
'src' => '',
'id' => 'signature_thumb',
'class' => [
'align-right',
],
'width' => '120px',
'height' => '60px',
],
];
$element['#suffix'] = \Drupal::service('renderer')
->renderPlain($sign_thumb);
return $element;
}