public function addControl(Miao_Form_Control $obj) { $index = $obj->getName(); if (array_key_exists($index, $this->_controls)) { $msg = sprintf('Control with name (%s) already exists', $index); throw new Miao_Form_Exception($msg); } $this->_controls[$index] = $obj; }
public function addControl($key, Miao_Form_Control $control) { $newControl = clone $control; $newControl->setValue(null); $controlName = $control->getName(); $name = $this->_makeName($key, $controlName); $newControl->setName($name); $this->_controlList[$controlName] = $newControl; return $this; }
protected function _makeName($key) { $controlName = $this->_prototype->getName(); $name = sprintf('%s[%s]', $controlName, $key); return $name; }
public function addControl(Miao_Form_Control $control) { $this->_controlPrototypeList[$control->getName()] = $control; return $this; }