private function updateElementsNamespace($fieldSetName, AbstractComponent $component) { if ($component instanceof AbstractElement) { $name = $component->getAttribute('name'); $pos = strpos($name, '['); if ($pos !== false) { $name = $fieldSetName . '[' . substr($name, 0, $pos) . ']' . substr($name, $pos); } else { $name = $fieldSetName . '[' . $name . ']'; } $component->setAttribute('name', $name); return; } foreach ($component->getComponents() as $c) { $component->updateElementsNamespace($fieldSetName, $c); } }
public function __construct($name) { parent::__construct($name); $this->attributes['name'] = $name; $this->rules['value'] = 'required'; }