Mercurial > hg > isophonics-drupal-site
annotate core/modules/serialization/serialization.module @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | af1871eacc83 |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 /** |
Chris@0 | 4 * @file |
Chris@0 | 5 * Provides a service for (de)serializing data to/from formats such as JSON and XML. |
Chris@0 | 6 */ |
Chris@0 | 7 |
Chris@18 | 8 use Drupal\Core\Url; |
Chris@0 | 9 use Drupal\Core\Routing\RouteMatchInterface; |
Chris@0 | 10 |
Chris@0 | 11 /** |
Chris@0 | 12 * Implements hook_help(). |
Chris@0 | 13 */ |
Chris@0 | 14 function serialization_help($route_name, RouteMatchInterface $route_match) { |
Chris@0 | 15 switch ($route_name) { |
Chris@0 | 16 case 'help.page.serialization': |
Chris@0 | 17 $output = ''; |
Chris@0 | 18 $output .= '<h3>' . t('About') . '</h3>'; |
Chris@0 | 19 $output .= '<p>' . t('The Serialization module provides a service for serializing and deserializing data to and from formats such as JSON and XML.') . '</p>'; |
Chris@0 | 20 $output .= '<p>' . t('Serialization is the process of converting data structures like arrays and objects into a string. This allows the data to be represented in a way that is easy to exchange and store (for example, for transmission over the Internet or for storage in a local file system). These representations can then be deserialized to get back to the original data structures.') . '</p>'; |
Chris@0 | 21 $output .= '<p>' . t('The serializer splits this process into two parts. Normalization converts an object to a normalized array structure. Encoding takes that array and converts it to a string.') . '</p>'; |
Chris@18 | 22 $output .= '<p>' . t('This module does not have a user interface. It is used by other modules which need to serialize data, such as <a href=":rest">REST</a>.', [':rest' => (\Drupal::moduleHandler()->moduleExists('rest')) ? Url::fromRoute('help.page', ['name' => 'rest'])->toString() : '#']) . '</p>'; |
Chris@0 | 23 $output .= '<p>' . t('For more information, see the <a href=":doc_url">online documentation for the Serialization module</a>.', [':doc_url' => 'https://www.drupal.org/documentation/modules/serialization']) . '</p>'; |
Chris@0 | 24 return $output; |
Chris@0 | 25 } |
Chris@0 | 26 } |