LinkMediaBase.php in Metatag 8
File
metatag_mobile/src/Plugin/metatag/Tag/LinkMediaBase.php
View source
<?php
namespace Drupal\metatag_mobile\Plugin\metatag\Tag;
use Drupal\metatag\Plugin\metatag\Tag\LinkRelBase;
abstract class LinkMediaBase extends LinkRelBase {
public function output() {
$element = parent::output();
if ($element) {
$element['#attributes'] = [
'rel' => $this
->name(),
'media' => $this
->media(),
'href' => $element['#attributes']['href'],
];
}
return $element;
}
protected function media() {
return '';
}
}
Classes
Name |
Description |
LinkMediaBase |
This base plugin allows "link rel" tags with a "media" attribute. |