Pure PHP
Pure phpiers are using used to something like detecting a submit in the _POST array.
if (isset($_POST['submit']) { ... } |
Of course for this you’ve to be sure the HTML contains an submit type element with name attribute equal to “submit”.
The Zend Framework’s Way
Simply replace the line above with:
if ($this->getRequest()->isPost()) { ... } |
This is way better than the first example. It detects the request method, not an array element!?
The `Zend_Controller_Request_Abstract` object has no member method `isPost()`. Which version did you use there? It can’t work.