lib: Introduce Controller::httpNotFound()
Many actions require loading specific objects from database or any other storage. If the object isn't found, Controller::httpNotFound($message) should be used for immediately returning w/ HTTP 404.
This commit is contained in:
parent
bd54784496
commit
902c00e836
|
@ -3,6 +3,7 @@
|
|||
|
||||
namespace Icinga\Web;
|
||||
|
||||
use Zend_Controller_Action_Exception;
|
||||
use Icinga\Data\Sortable;
|
||||
use Icinga\Data\QueryInterface;
|
||||
use Icinga\Web\Controller\ModuleActionController;
|
||||
|
@ -49,6 +50,18 @@ class Controller extends ModuleActionController
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Immediately respond w/ HTTP 404
|
||||
*
|
||||
* @param $message
|
||||
*
|
||||
* @throws Zend_Controller_Action_Exception
|
||||
*/
|
||||
public function httpNotFound($message)
|
||||
{
|
||||
throw new Zend_Controller_Action_Exception($message, 404);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a SortBox widget and apply its sort rules on the given query
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue