e482cf3a2405fc65bd704d96c0b79528c5eba0a5
[yaffs-website] / web / modules / contrib / metatag / src / Plugin / metatag / Tag / LinkRelBase.php
1 <?php
2
3 namespace Drupal\metatag\Plugin\metatag\Tag;
4
5 /**
6  * This base plugin allows "link rel" tags to be further customized.
7  */
8 abstract class LinkRelBase extends MetaNameBase {
9
10   /**
11    * Display the meta tag.
12    */
13   public function output() {
14     $element = parent::output();
15     if ($element) {
16       $element['#tag'] = 'link';
17       $element['#attributes'] = [
18         'rel' => $this->name(),
19         'href' => $element['#attributes']['content'],
20       ];
21       unset($element['#attributes']['content']);
22     }
23
24     return $element;
25   }
26
27 }