CoolCMS API

Error4xxPresenter extends Presenter
in package

FinalYes

Handles 4xx HTTP error responses.

Attributes
#[Requires]
$methods: '*'
$forward: true

Table of Contents

Constants

FRONT_ERROR_PRESENTER  : mixed = ':Front:System:Error:default'
Front error page in the site theme and language ({@see \App\UI\Front\System\Presenters\ErrorPresenter}).
LOCALE_MAP  : mixed = ['cs' => 'cs_CZ', 'en' => 'en_US', 'sk' => 'sk_...
Short language code from the URL prefix mapped to the locale of the neon sources (same map as `TranslatorInitTrait`).
NON_FRONT_PATH  : mixed = '#^/(?:[a-z]{2}/)?(?:admin|api|cron|script|test...
Branches with their own URL prefix that do not get the front page (admin, API, cron...).

Properties

$translator  : Translator

Methods

renderDefault()  : void
startup()  : void
Renders 404/403/410 on the front end in the site theme and language, not in the bare Nette skeleton.

Constants

FRONT_ERROR_PRESENTER

Front error page in the site theme and language ({@see \App\UI\Front\System\Presenters\ErrorPresenter}).

private mixed FRONT_ERROR_PRESENTER = ':Front:System:Error:default'

LOCALE_MAP

Short language code from the URL prefix mapped to the locale of the neon sources (same map as `TranslatorInitTrait`).

private mixed LOCALE_MAP = ['cs' => 'cs_CZ', 'en' => 'en_US', 'sk' => 'sk_SK']

NON_FRONT_PATH

Branches with their own URL prefix that do not get the front page (admin, API, cron...).

private mixed NON_FRONT_PATH = '#^/(?:[a-z]{2}/)?(?:admin|api|cron|script|test)(?:/|$)#'

Properties

Methods

renderDefault()

public renderDefault(BadRequestException $exception) : void
Parameters
$exception : BadRequestException

startup()

Renders 404/403/410 on the front end in the site theme and language, not in the bare Nette skeleton.

public startup() : void

Front means a front presenter failed, or no route matched and the URL does not point to the admin/API branch or to a missing file (/www/..., *.jpg: building a whole page with menu and DB queries for every image is unwanted). The language is taken from the presenter, else from the URL prefix; an unknown prefix is resolved by ErrorPresenter with the main localization.

On this page

Search results