3c6ed8a85a5a8e578a8f50f99ab22ee0c0c7fbc5
[yaffs-website] / web / modules / contrib / metatag / tests / modules / metatag_test_custom_route / metatag_test_custom_route.module
1 <?php
2
3 /**
4  * @file
5  * Contains metatag_test_custom_route.module..
6  */
7
8 use Drupal\Core\Routing\RouteMatchInterface;
9
10 /**
11  * Implements hook_help().
12  */
13 function metatag_test_custom_route_help($route_name, RouteMatchInterface $route_match) {
14   switch ($route_name) {
15     // Main module help for the metatag_test_custom_route module.
16     case 'help.page.metatag_test_custom_route':
17       $output = '';
18       $output .= '<h3>' . t('About') . '</h3>';
19       $output .= '<p>' . t('Support module for testing handling of a custom route.') . '</p>';
20       return $output;
21
22     default:
23   }
24 }
25
26 /**
27  * Implements hook_metatag_route_entity().
28  */
29 function metatag_test_custom_route_metatag_route_entity(RouteMatchInterface $route_match) {
30   if ($route_match->getRouteName() === 'metatag_test_custom_route.entity_route') {
31     if ($entity_test = $route_match->getParameter('entity_test')) {
32       return $entity_test;
33     }
34   }
35 }