TYPO3CMS
9.5
Main Page
Related Pages
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Files
File List
File Members
All
$
d
e
r
u
Functions
Variables
$
e
r
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
ErrorPageController.php
Go to the documentation of this file.
1
<?php
2
declare(strict_types = 1);
3
namespace
TYPO3\CMS\Core\Controller
;
4
5
/*
6
* This file is part of the TYPO3 CMS project.
7
*
8
* It is free software; you can redistribute it and/or modify it under
9
* the terms of the GNU General Public License, either version 2
10
* of the License, or any later version.
11
*
12
* For the full copyright and license information, please read the
13
* LICENSE.txt file that was distributed with this source code.
14
*
15
* The TYPO3 project - inspiring people to share!
16
*/
17
18
use
TYPO3\CMS\Core\Core\Environment
;
19
use
TYPO3\CMS\Core\Messaging\AbstractMessage
;
20
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
21
use
TYPO3\CMS\Core\Utility\PathUtility
;
22
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContext;
23
use TYPO3Fluid\Fluid\View\TemplatePaths;
24
use TYPO3Fluid\Fluid\View\TemplateView;
25
30
class
ErrorPageController
31
{
36
protected
$view
;
37
42
protected
$severity
=
AbstractMessage::ERROR
;
43
47
public
function
__construct
()
48
{
49
$this->view = GeneralUtility::makeInstance(TemplateView::class);
50
$context =
new
RenderingContext($this->view);
51
$context->setControllerName(
'ErrorPage'
);
52
$context->setTemplatePaths(
new
TemplatePaths([
53
'templateRootPaths'
=> [
54
Environment::getFrameworkBasePath
() .
'/core/Resources/Private/Templates/ErrorPage/'
55
]
56
]));
57
$this->view->setRenderingContext($context);
58
}
59
69
public
function
errorAction
(
70
string
$title,
71
string
$message,
72
int
$severity
=
AbstractMessage::ERROR
,
73
int
$errorCode = 0
74
):
string
{
75
$this->severity =
$severity
;
76
$classes = [
77
AbstractMessage::NOTICE
=>
'notice'
,
78
AbstractMessage::INFO
=>
'information'
,
79
AbstractMessage::OK
=>
'ok'
,
80
AbstractMessage::WARNING
=>
'warning'
,
81
AbstractMessage::ERROR
=>
'error'
82
];
83
$this->view->assign(
'severityCssClass'
, $classes[$this->severity]);
84
$this->view->assign(
'severity'
, $this->severity);
85
$this->view->assign(
'message'
, $message);
86
$this->view->assign(
'title'
, $title);
87
$this->view->assign(
'errorCodeUrlPrefix'
, TYPO3_URL_EXCEPTION);
88
$this->view->assign(
'errorCode'
, $errorCode);
89
$this->view->assign(
'logo'
,
PathUtility::getAbsoluteWebPath
(
Environment::getFrameworkBasePath
() .
'/backend/Resources/Public/Images/typo3_orange.svg'
));
90
$this->view->assign(
'cssFile'
,
PathUtility::getAbsoluteWebPath
(
Environment::getFrameworkBasePath
() .
'/core/Resources/Public/Css/errorpage.css'
));
91
$this->view->assign(
'copyrightYear'
, TYPO3_copyright_year);
92
return
$this->view->render(
'Error'
);
93
}
94
}
TYPO3\CMS\Core\Utility\PathUtility
Definition:
PathUtility.php:23
TYPO3\CMS\Core\Messaging\AbstractMessage
Definition:
AbstractMessage.php:24
TYPO3\CMS\Core\Controller\ErrorPageController
Definition:
ErrorPageController.php:31
TYPO3\CMS\Core\Controller\ErrorPageController\$severity
int $severity
Definition:
ErrorPageController.php:40
TYPO3\CMS\Core\Controller\ErrorPageController\$view
TemplateView $view
Definition:
ErrorPageController.php:35
TYPO3\CMS\Core\Controller
Definition:
ErrorPageController.php:3
TYPO3\CMS\Core\Core\Environment\getFrameworkBasePath
static string getFrameworkBasePath()
Definition:
Environment.php:234
TYPO3\CMS\Core\Messaging\AbstractMessage\WARNING
const WARNING
Definition:
AbstractMessage.php:28
TYPO3\CMS\Core\Controller\ErrorPageController\__construct
__construct()
Definition:
ErrorPageController.php:45
TYPO3\CMS\Core\Messaging\AbstractMessage\OK
const OK
Definition:
AbstractMessage.php:27
TYPO3\CMS\Core\Messaging\AbstractMessage\INFO
const INFO
Definition:
AbstractMessage.php:26
TYPO3\CMS\Core\Core\Environment
Definition:
Environment.php:39
TYPO3\CMS\Core\Controller\ErrorPageController\errorAction
string errorAction(string $title, string $message, int $severity=AbstractMessage::ERROR, int $errorCode=0)
Definition:
ErrorPageController.php:67
TYPO3\CMS\Core\Messaging\AbstractMessage\NOTICE
const NOTICE
Definition:
AbstractMessage.php:25
TYPO3\CMS\Core\Utility\GeneralUtility
Definition:
GeneralUtility.php:45
TYPO3\CMS\Core\Utility\PathUtility\getAbsoluteWebPath
static string getAbsoluteWebPath($targetPath)
Definition:
PathUtility.php:42
TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR
const ERROR
Definition:
AbstractMessage.php:29
doxygen
typo3
sysext
core
Classes
Controller
ErrorPageController.php
Generated on Tue Oct 5 2021 01:57:03 for TYPO3CMS by
1.8.18