You are here

name.api.php in Name Field 8

Same filename and directory in other branches
  1. 7 name.api.php

Hooks for the Name field module.

File

name.api.php
View source
<?php

/**
 * @file
 * Hooks for the Name field module.
 */

/**
 * @addtogroup hooks
 * @{
 */

/**
 * Provide widget layout options.
 *
 * By implementing hook_name_widget_layouts(), a module can provide additional
 * layout options for a name field element.
 *
 * For usage example, see hook_name_widget_layouts().
 *
 * @return array
 *   A keyed array of layout settings.
 *   - label: The layout label (required).
 *   - library: An array of libraries to attach to the element.
 *   - wrapper_attributes: An array of wrapper attributes.
 */
function hook_name_widget_layouts() {
  return [
    'inline' => [
      'label' => t('Inline'),
      'library' => [
        'name/widget.inline',
      ],
      'wrapper_attributes' => [
        'class' => [
          'form--inline',
          'clearfix',
        ],
      ],
    ],
  ];
}

/**
 * @} End of "addtogroup hooks".
 */

Functions

Namesort descending Description
hook_name_widget_layouts Provide widget layout options.