dreamjob/lib/Cake/Test/test_app/Error/TestAppsExceptionRenderer.php

22 lines
548 B
PHP
Raw Permalink Normal View History

2015-03-31 14:49:03 +02:00
<?php
class TestAppsExceptionRenderer extends ExceptionRenderer {
protected function _getController($exception) {
App::uses('TestAppsErrorController', 'Controller');
if (!$request = Router::getRequest(true)) {
$request = new CakeRequest();
}
$response = new CakeResponse();
try {
$controller = new TestAppsErrorController($request, $response);
$controller->layout = 'banana';
} catch (Exception $e) {
$controller = new Controller($request, $response);
$controller->viewPath = 'Errors';
}
return $controller;
}
}