You are here

public function FlexiformRepeatableElement::makeElementNamespace in Flexiform 7

Make a namespace for the element.

If that namespace is already taken then make a new one.

Overrides FlexiformElement::makeElementNamespace

File

includes/flexiform.element_repeatable.inc, line 18
Contains the FlexiformRepeatableElement class.

Class

FlexiformRepeatableElement
Class for Elements that can be added to the form more than once with different configurations.

Code

public function makeElementNamespace() {
  $namespace = parent::makeElementNamespace();
  $full_namespace = $namespace;
  $delta = 0;
  while (!empty($this->flexiform->elements[$full_namespace])) {
    $full_namespace = $namespace . ':' . $delta;
    $delta++;
  }
  return $full_namespace;
}