Drupal investigation

hal.module 1.2KB

123456789101112131415161718192021222324
  1. <?php
  2. /**
  3. * @file
  4. * Adds support for serializing entities to Hypertext Application Language.
  5. */
  6. use Drupal\Core\Routing\RouteMatchInterface;
  7. /**
  8. * Implements hook_help().
  9. */
  10. function hal_help($route_name, RouteMatchInterface $route_match) {
  11. switch ($route_name) {
  12. case 'help.page.hal':
  13. $output = '';
  14. $output .= '<h3>' . t('About') . '</h3>';
  15. $output .= '<p>' . t('<a href=":hal_spec">Hypertext Application Language (HAL)</a> is a format that supports the linking required for hypermedia APIs.', [':hal_spec' => 'http://stateless.co/hal_specification.html']) . '</p>';
  16. $output .= '<p>' . t('Hypermedia APIs are a style of Web API that uses URIs to identify resources and the <a href="http://wikipedia.org/wiki/Link_relation">link relations</a> between them, enabling API consumers to follow links to discover API functionality.') . '</p>';
  17. $output .= '<p>' . t('This module adds support for serializing entities (such as content items, taxonomy terms, etc.) to the JSON version of HAL. For more information, see the <a href=":hal_do">online documentation for the HAL module</a>.', [':hal_do' => 'https://www.drupal.org/documentation/modules/hal']) . '</p>';
  18. return $output;
  19. }
  20. }