public function addElement(FormElement $element) {

		if(!empty($this->elements[$element->getName()])) {
			
			throw new HtmlFormException(sprintf("Element '%s' already assigned.", $element->getName()));
			
		}

		$this->elements[$element->getName()] = $element;
		$element->setForm($this);

		return $this;

	}
public function addElement(FormElement $element) {

		if(!empty($this->elements[$element->getName()])) {
			
			throw new HtmlFormException(sprintf("Element '%s' already assigned.", $element->getName()));
			
		}

		$this->elements[$element->getName()] = $element;
		$element->setForm($this);

		return $this;

	}
public function addElement ( FormElement $ element ) { if ( ! empty ( $ this -> elements [ $ element -> getName ( ) ] ) ) { throw new HtmlFormException ( sprintf ( "Element '%s' already assigned." , $ element -> getName ( ) ) ) ; } $ this -> elements [ $ element -> getName ( ) ] = $ element ; $ element -> setForm ( $ this ) ; return $ this ; }
add form element to form

@param FormElement $element
@throws HtmlFormException
@return \vxPHP\Form\HtmlForm
add form element to form