How can I check if request is post in Zend Framework

Jiew Meng picture Jiew Meng · Dec 19, 2010 · Viewed 29.2k times · Source

I remember using something like

$this->getRequest()->isPost()

but it seems like there isn't such a function. How can I check if the request is post so I can validate the form etc

Answer

Maxence picture Maxence · Dec 19, 2010

$this->getRequest() in the context of a controller is annoted to return an object of class Zend_Controller_Request_Abstract. isPost() is a method of Zend_Controller_Request_Http which is derived from Zend_Controller_Request_Abstract.
So your IDE cannot offer this method, but it is there.