annotate core/modules/hal/hal.module @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 /**
Chris@0 4 * @file
Chris@0 5 * Adds support for serializing entities to Hypertext Application Language.
Chris@0 6 */
Chris@0 7
Chris@0 8 use Drupal\Core\Routing\RouteMatchInterface;
Chris@0 9
Chris@0 10 /**
Chris@0 11 * Implements hook_help().
Chris@0 12 */
Chris@0 13 function hal_help($route_name, RouteMatchInterface $route_match) {
Chris@0 14 switch ($route_name) {
Chris@0 15 case 'help.page.hal':
Chris@0 16 $output = '';
Chris@0 17 $output .= '<h3>' . t('About') . '</h3>';
Chris@0 18 $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>';
Chris@0 19 $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>';
Chris@0 20 $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>';
Chris@0 21 return $output;
Chris@0 22 }
Chris@0 23 }