getAttribute('name'))//should we leave it like that? return; $this->_renameChildren($form_name, $this->children); $this->tag = 'form'; } function _renameChildren($form_name, $children) { foreach($children as $child) { if(is_a($child, 'WactControlTag') && ($name = $child->getAttribute('name'))) { $child->removeAttribute('name'); $child->setAttribute('name', $form_name . $this->_makeWrappedName($name)); } if(sizeof($child->children) > 0) $this->_renameChildren($form_name, $child->children); } } function _makeWrappedName($name) { return preg_replace('/^([^\[\]]+)(\[.*\])*$/', "[\\1]\\2", $name); } } ?>