Archived
1
0
Fork 0
This repository has been archived on 2026-05-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
fiktivkod/application/modules/default/controllers/ErrorController.php
2010-09-07 22:15:07 +02:00

34 lines
No EOL
1 KiB
PHP

<?php
class ErrorController extends Fiktiv_Controller_Action
{
public function errorAction()
{
$error = $this->_getParam('error_handler');
// display debug information if we are in a developer environment.
if (ini_get('display_errors')) {
$this->_helper->layout->setLayout('clean');
$this->view->error = $error;
$this->render('debug');
return;
}
switch($error->type) {
// 404 - Page not found
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION :
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER :
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE :
$this->_forward('page-not-found');
break;
// 500 - Application error
default :
$this->getResponse()->setHttpResponseCode(500);
}
}
public function pageNotFoundAction()
{
$this->getResponse()->setHttpResponseCode(404);
}
}