You are here

function jsonapi_help in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/jsonapi/jsonapi.module \jsonapi_help()

Implements hook_help().

File

core/modules/jsonapi/jsonapi.module, line 83
Module implementation file.

Code

function jsonapi_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.jsonapi':
      $output = '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('The JSON:API module is a fully compliant implementation of the <a href=":spec">JSON:API Specification</a>. By following shared conventions, you can increase productivity, take advantage of generalized tooling, and focus on what matters: your application. Clients built around JSON:API are able to take advantage of features like efficient response caching, which can sometimes eliminate network requests entirely. For more information, see the <a href=":docs">online documentation for the JSON:API module</a>.', [
        ':spec' => 'https://jsonapi.org',
        ':docs' => 'https://www.drupal.org/docs/8/modules/json-api',
      ]) . '</p>';
      $output .= '<dl>';
      $output .= '<dt>' . t('General') . '</dt>';
      $output .= '<dd>' . t('JSON:API is a particular implementation of REST that provides conventions for resource relationships, collections, filters, pagination, and sorting. These conventions help developers build clients faster and encourages reuse of code.') . '</dd>';
      $output .= '<dd>' . t('The <a href=":jsonapi-docs">JSON:API</a> and <a href=":rest-docs">RESTful Web Services</a> modules serve similar purposes. <a href=":comparison">Read the comparison of the RESTFul Web Services and JSON:API modules</a> to determine the best choice for your site.', [
        ':jsonapi-docs' => 'https://www.drupal.org/docs/8/modules/json-api',
        ':rest-docs' => 'https://www.drupal.org/docs/8/core/modules/rest',
        ':comparison' => 'https://www.drupal.org/docs/8/modules/jsonapi/jsonapi-vs-cores-rest-module',
      ]) . '</dd>';
      $output .= '<dd>' . t('Some multilingual features currently do not work well with JSON:API. See the <a href=":jsonapi-docs">JSON:API multilingual support documentation</a> for more information on the current status of multilingual support.', [
        ':jsonapi-docs' => 'https://www.drupal.org/docs/8/modules/jsonapi/translations',
      ]) . '</dd>';
      $output .= '<dd>' . t('Revision support is currently read-only and only for the "Content" and "Media" entity types in JSON:API. See the <a href=":jsonapi-docs">JSON:API revision support documentation</a> for more information on the current status of revision support.', [
        ':jsonapi-docs' => 'https://www.drupal.org/docs/8/modules/jsonapi/revisions',
      ]) . '</dd>';
      $output .= '</dl>';
      return $output;
  }
  return NULL;
}