public function removeFieldByName($name)
    {
        foreach ($this->fields as $i => $field) {
            if ($field->getName() == $name) {
                unset($this->fields[$i]);
                break;
            }
        }

        return $this;
    }
public function removeFieldByName($name)
    {
        foreach ($this->fields as $i => $field) {
            if ($field->getName() == $name) {
                unset($this->fields[$i]);
                break;
            }
        }

        return $this;
    }
public function removeFieldByName ( $ name ) { foreach ( $ this -> fields as $ i => $ field ) { if ( $ field -> getName ( ) == $ name ) { unset ( $ this -> fields [ $ i ] ) ; break ; } } return $ this ; }
Remove a field from the form by the name of the field.
If there are more then 1 field with the given name, then only the first one will
be removed.

@param $name
@return Form
Remove a field from the form by the name of the field . If there are more then 1 field with the given name then only the first one will be removed .