hook_field_formatter_info

Definition

hook_field_formatter_info()
cck.pre-rename/field.php, line 238

Description

Declare information about a formatter.

Return value

An array keyed by formatter name. Each element of the array is an associative array with these keys and values:

  • "label": The human-readable label for the formatter.
  • "field types": An array of field type names that can be displayed using this formatter.

Related topics

Namesort iconDescription
HooksAllow modules to interact with the Drupal core.

Code

<?php
function hook_field_formatter_info() {
  return array(
    'default' => array(
      'label' => t('Default'),
      'field types' => array('text'),
    ),
    'plain' => array(
      'label' => t('Plain text'),
      'field types' => array('text'),
    ),
    'trimmed' => array(
      'label' => t('Trimmed'),
      'field types' => array('text'),
    ),
  );
}
?>