You are here

signature_field.module in Signature Field 8

An example field using the Field Types API.

File

signature_field.module
View source
<?php

/**
 * @file
 * An example field using the Field Types API.
 */

/**
 * @defgroup signature_field Example: Field Types API
 * @ingroup examples
 * @{
 * Examples using Field Types API.
 *
 * Providing a field requires:
 * - Defining an entity field item. Entity field items are typed data objects
 *   containing the field values.
 *   - Drupal\signature_field\Plugin\Field\FieldType\SignatureField
 * - One or more widgets specifying how the field appears in edit forms
 *   - Drupal\signature_field\Plugin\Field\SignatureWidget
 * - One or more formatters specifying how the field appears in displayed
 *   entities
 *   - Drupal\signature_field\Plugin\FieldFormatter\SignatureFormatter
 *
 * @see field_types
 * @see field
 * @see schemaapi
 *
 * @} End of "defgroup signature_field".
 */

/**
 * Implements hook_theme().
 */
function signature_field_theme() {
  $theme = [];
  $theme['signature'] = [
    'render element' => 'element',
    'variables' => array(
      'sign_src' => '',
    ),
  ];
  return $theme;
}

Functions

Namesort descending Description
signature_field_theme Implements hook_theme().