Example #1
0
 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;
 }
Example #2
0
 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;
 }
Example #3
0
 protected function _makeName($key)
 {
     $controlName = $this->_prototype->getName();
     $name = sprintf('%s[%s]', $controlName, $key);
     return $name;
 }
Example #4
0
 public function addControl(Miao_Form_Control $control)
 {
     $this->_controlPrototypeList[$control->getName()] = $control;
     return $this;
 }