You are here

public static function VideoEmbedIFrame::preRenderInlineFrameEmbed in Video Embed Field 8.2

Same name and namespace in other branches
  1. 8 src/Element/VideoEmbedIFrame.php \Drupal\video_embed_field\Element\VideoEmbedIFrame::preRenderInlineFrameEmbed()

Transform the render element structure into a renderable one.

Parameters

array $element: An element array before being processed.

Return value

array The processed and renderable element.

File

src/Element/VideoEmbedIFrame.php, line 41

Class

VideoEmbedIFrame
Providers an element design for embedding iframes.

Namespace

Drupal\video_embed_field\Element

Code

public static function preRenderInlineFrameEmbed($element) {
  $element['#theme'] .= !empty($element['#provider']) ? '__' . $element['#provider'] : '';
  if (is_array($element['#attributes'])) {
    $element['#attributes'] = new Attribute($element['#attributes']);
  }
  return $element;
}