/**
  * Add an element to the form
  *
  * @access public
  * @author Cédric Alfonsi, <*****@*****.**>
  * @param  FormElement element
  * @return mixed
  */
 public function addElement(tao_helpers_form_FormElement $element)
 {
     $elementPosition = -1;
     foreach ($this->elements as $i => $elt) {
         if ($elt->getName() == $element->getName()) {
             $elementPosition = $i;
             break;
         }
     }
     if ($elementPosition >= 0) {
         $this->elements[$elementPosition] = $element;
     } else {
         $this->elements[] = $element;
     }
 }
示例#2
0
 /**
  * Short description of method __construct
  *
  * @access public
  * @author Joel Bout, <*****@*****.**>
  * @param  string name
  * @return mixed
  */
 public function __construct($name = '')
 {
     parent::__construct($name);
     $this->addValidators(array(tao_helpers_form_FormFactory::getValidator('Password'), tao_helpers_form_FormFactory::getValidator('Length', array('min' => 3))));
 }