Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FieldLabelOptionsTrait.php

function FieldLabelOptionsTrait::getFieldLabelOptions

Returns an array of visibility options for field labels.

Return value

array An array of visibility options.

2 calls to FieldLabelOptionsTrait::getFieldLabelOptions()
EntityViewDisplayEditForm::buildFieldRow in core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php
Builds the table row structure for a single field.
FieldBlock::blockForm in core/modules/layout_builder/src/Plugin/Block/FieldBlock.php

File

core/modules/field/src/FieldLabelOptionsTrait.php, line 16

Class

FieldLabelOptionsTrait
Provides a trait for the valid field label options.

Namespace

Drupal\field

Code

protected function getFieldLabelOptions() : array {
    return [
        'above' => $this->t('Above'),
        'inline' => $this->t('Inline'),
        'hidden' => '- ' . $this->t('Hidden') . ' -',
        'visually_hidden' => '- ' . $this->t('Visually Hidden') . ' -',
    ];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal