You are here

public function LinkMediaBase::output in Metatag 8

Generate the HTML tag output for a meta tag.

Return value

array|string A render array or an empty string.

Overrides LinkRelBase::output

File

metatag_mobile/src/Plugin/metatag/Tag/LinkMediaBase.php, line 15

Class

LinkMediaBase
This base plugin allows "link rel" tags with a "media" attribute.

Namespace

Drupal\metatag_mobile\Plugin\metatag\Tag

Code

public function output() {
  $element = parent::output();
  if ($element) {
    $element['#attributes'] = [
      'rel' => $this
        ->name(),
      'media' => $this
        ->media(),
      'href' => $element['#attributes']['href'],
    ];
  }
  return $element;
}