I would like to intentionally cause a 404 error within one of the controllers in my Zend Framework application. How can I do this?
You can always set the response code manually, without throwing any exceptions.
$this->_response->clearBody(); $this->_response->clearHeaders(); $this->_response->setHttpResponseCode(404);