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