You are here

function hook_name_widget_layouts in Name Field 8

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 value

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.
1 function implements hook_name_widget_layouts()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

name_name_widget_layouts in ./name.module
Implements hook_name_widget_layouts().
1 invocation of hook_name_widget_layouts()
name_widget_layouts in ./name.module
Helper function to get any defined name widget layout options.

File

./name.api.php, line 27
Hooks for the Name field module.

Code

function hook_name_widget_layouts() {
  return [
    'inline' => [
      'label' => t('Inline'),
      'library' => [
        'name/widget.inline',
      ],
      'wrapper_attributes' => [
        'class' => [
          'form--inline',
          'clearfix',
        ],
      ],
    ],
  ];
}