You are here

function jsonapi_help in JSON:API 8

Same name and namespace in other branches
  1. 8.2 jsonapi.module \jsonapi_help()

Implements hook_help().

File

./jsonapi.module, line 82
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 its features such as efficiently caching responses, sometimes eliminating network requests entirely. For more information, see the <a href=":docs">online documentation for the JSON API module</a>.', [
        ':spec' => 'http://jsonapi.org',
        ':docs' => 'https://www.youtube.com/playlist?list=PLZOQ_ZMpYrZsyO-3IstImK1okrpfAjuMZ',
      ]) . '</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, in addition to error handling and full test coverage. These conventions help developers build clients faster and encourages reuse of code.') . '</dd>';
      $output .= '</dl>';
      return $output;
  }
  return NULL;
}