You are here

public function ElementClassTrait::elementClassSettingsForm in Element Class Formatter 8

Setting form to collect class value.

Parameters

array $elements: The original elements render array.

string $class: The class string.

Return value

array The updated elements render array.

7 calls to ElementClassTrait::elementClassSettingsForm()
ElementEntityClassTrait::settingsForm in src/Plugin/Field/FieldFormatter/ElementEntityClassTrait.php
ElementLinkClassTrait::settingsForm in src/Plugin/Field/FieldFormatter/ElementLinkClassTrait.php
ElementListClassTrait::settingsForm in src/Plugin/Field/FieldFormatter/ElementListClassTrait.php
EntityReferenceLabelClassFormatter::settingsForm in src/Plugin/Field/FieldFormatter/EntityReferenceLabelClassFormatter.php
Returns a form to configure settings for the formatter.
FileLinkClassFormatter::settingsForm in src/Plugin/Field/FieldFormatter/FileLinkClassFormatter.php
Returns a form to configure settings for the formatter.

... See full list

File

src/Plugin/Field/FieldFormatter/ElementClassTrait.php, line 43

Class

ElementClassTrait
Trait ElementClassTrait.

Namespace

Drupal\element_class_formatter\Plugin\Field\FieldFormatter

Code

public function elementClassSettingsForm(array $elements, $class) {
  $elements['class'] = [
    '#type' => 'textfield',
    '#default_value' => $class,
    '#title' => $this
      ->t('Element class'),
    '#description' => 'A space separated set of classes.',
    '#maxlength' => 200,
  ];
  return $elements;
}