src/Form/Base.php
public function addFormElement(array $element, $options = array())
    {
        if (array_key_exists($element['name'], $this->formElements)) {
            throw new \Exception('Form element "'.$element['name'].'" is already added, use replaceFormElement() or removeElement() instead');
        }
    	$this->formElements[$element['name']] = $element;
        if (!empty($options) && is_array($options)) {
            $this->formElementOptions[$element['name']] = $options;
        }
        return $this;
    }
public function addFormElement(array $element, $options = array())
    {
        if (array_key_exists($element['name'], $this->formElements)) {
            throw new \Exception('Form element "'.$element['name'].'" is already added, use replaceFormElement() or removeElement() instead');
        }
    	$this->formElements[$element['name']] = $element;
        if (!empty($options) && is_array($options)) {
            $this->formElementOptions[$element['name']] = $options;
        }
        return $this;
    }
public function addFormElement ( array $ element , $ options = array ( ) ) { if ( array_key_exists ( $ element [ 'name' ] , $ this -> formElements ) ) { throw new \ Exception ( 'Form element "' . $ element [ 'name' ] . '" is already added, use replaceFormElement() or removeElement() instead' ) ; } $ this -> formElements [ $ element [ 'name' ] ] = $ element ; if ( ! empty ( $ options ) && is_array ( $ options ) ) { $ this -> formElementOptions [ $ element [ 'name' ] ] = $ options ; } return $ this ; }
Add form element using short syntax

@param array $element
@return $this
Add form element using short syntax