mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-17 20:38:25 +00:00
22 lines
599 B
PHP
22 lines
599 B
PHP
|
<?php
|
||
|
|
||
|
class TestAppsExceptionRenderer extends ExceptionRenderer {
|
||
|
|
||
|
protected function _getController($exception) {
|
||
|
App::uses('TestAppsErrorController', 'Controller');
|
||
|
if (!$request = Router::getRequest(true)) {
|
||
|
$request = new CakeRequest();
|
||
|
}
|
||
|
$response = new CakeResponse(array('charset' => Configure::read('App.encoding')));
|
||
|
try {
|
||
|
$controller = new TestAppsErrorController($request, $response);
|
||
|
$controller->layout = 'banana';
|
||
|
} catch (Exception $e) {
|
||
|
$controller = new Controller($request, $response);
|
||
|
$controller->viewPath = 'Errors';
|
||
|
}
|
||
|
return $controller;
|
||
|
}
|
||
|
|
||
|
}
|