You are here

protected function ComponentSectionForm::getFormElementNameFromData in Module Builder 8.3

1 call to ComponentSectionForm::getFormElementNameFromData()
ComponentSectionForm::buildFormElement in src/Form/ComponentSectionForm.php
Builds the form element for a data item.

File

src/Form/ComponentSectionForm.php, line 361

Class

ComponentSectionForm
Generic form for entering a section of data for a component.

Namespace

Drupal\module_builder\Form

Code

protected function getFormElementNameFromData($data_item) {
  $pieces = explode(':', $data_item
    ->getAddress());
  $name = array_shift($pieces);
  foreach ($pieces as $piece) {
    $name .= "[{$piece}]";
  }
  return $name;
}