public function setMethod($method)
    {
        $method = strtolower($method);

        if (in_array($method, [Form::METHOD_GET, Form::METHOD_POST])) {
            $this->method = $method;
        } else {
            throw new \Exception('Incorrect method value given');
        }
        return $this;
    }
public function setMethod($method)
    {
        $method = strtolower($method);

        if (in_array($method, [Form::METHOD_GET, Form::METHOD_POST])) {
            $this->method = $method;
        } else {
            throw new \Exception('Incorrect method value given');
        }
        return $this;
    }
public function setMethod ( $ method ) { $ method = strtolower ( $ method ) ; if ( in_array ( $ method , [ Form :: METHOD_GET , Form :: METHOD_POST ] ) ) { $ this -> method = $ method ; } else { throw new \ Exception ( 'Incorrect method value given' ) ; } return $ this ; }
Set the method how this form should be submitted

@param string $method
@return Form
@throws \Exception
Set the method how this form should be submitted