You are here

public function FieldGroupFormatterBase::settingsForm in Field Group 8

Same name and namespace in other branches
  1. 8.3 src/FieldGroupFormatterBase.php \Drupal\field_group\FieldGroupFormatterBase::settingsForm()

Returns a form to configure settings for the formatter.

Invoked in field_group_field_ui_display_form_alter to allow administrators to configure the formatter. The field_group module takes care of handling submitted form values.

Return value

array The form elements for the formatter settings.

Overrides FieldGroupFormatterInterface::settingsForm

7 calls to FieldGroupFormatterBase::settingsForm()
Accordion::settingsForm in src/Plugin/field_group/FieldGroupFormatter/Accordion.php
Returns a form to configure settings for the formatter.
AccordionItem::settingsForm in src/Plugin/field_group/FieldGroupFormatter/AccordionItem.php
Returns a form to configure settings for the formatter.
Details::settingsForm in src/Plugin/field_group/FieldGroupFormatter/Details.php
Returns a form to configure settings for the formatter.
Fieldset::settingsForm in src/Plugin/field_group/FieldGroupFormatter/Fieldset.php
Returns a form to configure settings for the formatter.
HtmlElement::settingsForm in src/Plugin/field_group/FieldGroupFormatter/HtmlElement.php
Returns a form to configure settings for the formatter.

... See full list

7 methods override FieldGroupFormatterBase::settingsForm()
Accordion::settingsForm in src/Plugin/field_group/FieldGroupFormatter/Accordion.php
Returns a form to configure settings for the formatter.
AccordionItem::settingsForm in src/Plugin/field_group/FieldGroupFormatter/AccordionItem.php
Returns a form to configure settings for the formatter.
Details::settingsForm in src/Plugin/field_group/FieldGroupFormatter/Details.php
Returns a form to configure settings for the formatter.
Fieldset::settingsForm in src/Plugin/field_group/FieldGroupFormatter/Fieldset.php
Returns a form to configure settings for the formatter.
HtmlElement::settingsForm in src/Plugin/field_group/FieldGroupFormatter/HtmlElement.php
Returns a form to configure settings for the formatter.

... See full list

File

src/FieldGroupFormatterBase.php, line 82

Class

FieldGroupFormatterBase
Base class for 'Fieldgroup formatter' plugin implementations.

Namespace

Drupal\field_group

Code

public function settingsForm() {
  $form = array();
  $form['label'] = array(
    '#type' => 'textfield',
    '#title' => t('Field group label'),
    '#default_value' => $this->label,
    '#weight' => -5,
  );
  $form['id'] = array(
    '#title' => t('ID'),
    '#type' => 'textfield',
    '#default_value' => $this
      ->getSetting('id'),
    '#weight' => 10,
    '#element_validate' => array(
      'field_group_validate_id',
    ),
  );
  $form['classes'] = array(
    '#title' => t('Extra CSS classes'),
    '#type' => 'textfield',
    '#default_value' => $this
      ->getSetting('classes'),
    '#weight' => 11,
    '#element_validate' => array(
      'field_group_validate_css_class',
    ),
  );
  return $form;
}