Version 1
[yaffs-website] / web / modules / contrib / metatag / src / Plugin / metatag / Tag / MetaHttpEquivBase.php
diff --git a/web/modules/contrib/metatag/src/Plugin/metatag/Tag/MetaHttpEquivBase.php b/web/modules/contrib/metatag/src/Plugin/metatag/Tag/MetaHttpEquivBase.php
new file mode 100644 (file)
index 0000000..8db004d
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * This base plugin allows "http-equiv"-style meta tags, e.g. the content
+ * language meta tag, to be further customized.
+ */
+
+namespace Drupal\metatag\Plugin\metatag\Tag;
+
+abstract class MetaHttpEquivBase extends MetaNameBase {
+  /**
+   * Display the meta tag.
+   */
+  public function output() {
+    if (empty($this->value)) {
+      // If there is no value, we don't want a tag output.
+      $element = '';
+    }
+    else {
+      $element = [
+        '#tag' => 'meta',
+        '#attributes' => [
+          'http-equiv' => $this->name,
+          'content' => $this->value(),
+        ]
+      ];
+    }
+
+    return $element;
+  }
+}