Guest User

Untitled

a guest
Jun 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <?php
  2.  
  3. class ErrorController extends Zend_Controller_Action
  4. {
  5.  
  6. public function errorAction()
  7. {
  8. $errors = $this->_getParam('error_handler');
  9.  
  10. switch ($errors->type) {
  11. case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
  12. case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
  13.  
  14. // 404 error -- controller or action not found
  15. $this->getResponse()->setHttpResponseCode(404);
  16. $this->view->message = 'Page not found';
  17. break;
  18. default:
  19. // application error
  20. $this->getResponse()->setHttpResponseCode(500);
  21. $this->view->message = 'Application error';
  22. break;
  23. }
  24.  
  25. $this->view->exception = $errors->exception;
  26. $this->view->request = $errors->request;
  27. }
  28.  
  29.  
  30. }
Add Comment
Please, Sign In to add comment