comparison core/modules/system/src/Controller/Http4xxController.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\system\Controller;
4
5 use Drupal\Core\Controller\ControllerBase;
6
7 /**
8 * Controller for default HTTP 4xx responses.
9 */
10 class Http4xxController extends ControllerBase {
11
12 /**
13 * The default 4xx error content.
14 *
15 * @return array
16 * A render array containing the message to display for 4xx errors.
17 */
18 public function on4xx() {
19 return [
20 '#markup' => $this->t('A client error happened'),
21 ];
22 }
23
24 /**
25 * The default 401 content.
26 *
27 * @return array
28 * A render array containing the message to display for 401 pages.
29 */
30 public function on401() {
31 return [
32 '#markup' => $this->t('Please log in to access this page.'),
33 ];
34 }
35
36 /**
37 * The default 403 content.
38 *
39 * @return array
40 * A render array containing the message to display for 403 pages.
41 */
42 public function on403() {
43 return [
44 '#markup' => $this->t('You are not authorized to access this page.'),
45 ];
46 }
47
48 /**
49 * The default 404 content.
50 *
51 * @return array
52 * A render array containing the message to display for 404 pages.
53 */
54 public function on404() {
55 return [
56 '#markup' => $this->t('The requested page could not be found.'),
57 ];
58 }
59
60 }