Version 1
[yaffs-website] / web / modules / contrib / metatag / tests / modules / metatag_test_custom_route / metatag_test_custom_route.module
diff --git a/web/modules/contrib/metatag/tests/modules/metatag_test_custom_route/metatag_test_custom_route.module b/web/modules/contrib/metatag/tests/modules/metatag_test_custom_route/metatag_test_custom_route.module
new file mode 100644 (file)
index 0000000..3c6ed8a
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * @file
+ * Contains metatag_test_custom_route.module..
+ */
+
+use Drupal\Core\Routing\RouteMatchInterface;
+
+/**
+ * Implements hook_help().
+ */
+function metatag_test_custom_route_help($route_name, RouteMatchInterface $route_match) {
+  switch ($route_name) {
+    // Main module help for the metatag_test_custom_route module.
+    case 'help.page.metatag_test_custom_route':
+      $output = '';
+      $output .= '<h3>' . t('About') . '</h3>';
+      $output .= '<p>' . t('Support module for testing handling of a custom route.') . '</p>';
+      return $output;
+
+    default:
+  }
+}
+
+/**
+ * Implements hook_metatag_route_entity().
+ */
+function metatag_test_custom_route_metatag_route_entity(RouteMatchInterface $route_match) {
+  if ($route_match->getRouteName() === 'metatag_test_custom_route.entity_route') {
+    if ($entity_test = $route_match->getParameter('entity_test')) {
+      return $entity_test;
+    }
+  }
+}