Revize e59aa7c3
Přidáno uživatelem Filip Jani před téměř 6 roky(ů)
app/FrontModule/presenters/Error4xxPresenter.php | ||
---|---|---|
20 | 20 |
{ |
21 | 21 |
// load template 403.latte or 404.latte or ... 4xx.latte |
22 | 22 |
$file = __DIR__ . "/templates/Error/{$exception->getCode()}.latte"; |
23 |
$this->template->setFile(is_file($file) ? $file : __DIR__ . '/templates/Error/4xx.latte'); |
|
23 |
$this->template->setFile(is_file($file) ? $file : __DIR__ . '/../templates/Error/4xx.latte');
|
|
24 | 24 |
} |
25 | 25 |
} |
app/FrontModule/presenters/ErrorPresenter.php | ||
---|---|---|
34 | 34 |
$this->logger->log($exception, ILogger::EXCEPTION); |
35 | 35 |
return new Responses\CallbackResponse(function (Http\IRequest $httpRequest, Http\IResponse $httpResponse) { |
36 | 36 |
if (preg_match('#^text/html(?:;|$)#', $httpResponse->getHeader('Content-Type'))) { |
37 |
require __DIR__ . '/templates/Error/500.phtml'; |
|
37 |
require __DIR__ . '/../templates/Error/500.phtml';
|
|
38 | 38 |
} |
39 | 39 |
}); |
40 | 40 |
} |
app/config/config.neon | ||
---|---|---|
2 | 2 |
|
3 | 3 |
|
4 | 4 |
application: |
5 |
errorPresenter: Error |
|
5 |
errorPresenter: Front:Error
|
|
6 | 6 |
mapping: |
7 | 7 |
*: App\*Module\Presenters\*Presenter |
8 |
catchExceptions: true |
|
8 | 9 |
|
9 | 10 |
|
10 | 11 |
session: |
Také k dispozici: Unified diff
Úprava error presenterů pro zobrazování chyb