You are here

protected function ButtonFieldBase::elementId in Button Field 8

Same name in this branch
  1. 8 src/Plugin/Field/FieldFormatter/ButtonFieldBase.php \Drupal\button_field\Plugin\Field\FieldFormatter\ButtonFieldBase::elementId()
  2. 8 src/Plugin/Field/FieldWidget/ButtonFieldBase.php \Drupal\button_field\Plugin\Field\FieldWidget\ButtonFieldBase::elementId()

Builds the id for a button field element.

@todo Determine if there is a better way to do this.

1 call to ButtonFieldBase::elementId()
ButtonFieldBase::formElement in src/Plugin/Field/FieldWidget/ButtonFieldBase.php
@todo Add ajax callback.

File

src/Plugin/Field/FieldWidget/ButtonFieldBase.php, line 86
Contains Drupal\button_field\Plugin\Field\FieldWidget\ButtonFieldBase.

Class

ButtonFieldBase
Base implementation for button field widgets.

Namespace

Drupal\button_field\Plugin\Field\FieldWidget

Code

protected function elementId($delta, $language) {
  $parts = array(
    'edit',
    str_replace('_', '-', $this->fieldDefinition
      ->getName()),
    $language,
    $delta,
    'value',
  );
  return implode('-', $parts);
}