Web Interfaces of PROSUME

ErrorController.php 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  4. * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  5. *
  6. * Licensed under The MIT License
  7. * For full copyright and license information, please see the LICENSE.txt
  8. * Redistributions of files must retain the above copyright notice.
  9. *
  10. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  11. * @link https://cakephp.org CakePHP(tm) Project
  12. * @since 3.3.4
  13. * @license https://opensource.org/licenses/mit-license.php MIT License
  14. */
  15. namespace App\Controller;
  16. use Cake\Event\Event;
  17. /**
  18. * Error Handling Controller
  19. *
  20. * Controller used by ExceptionRenderer to render error responses.
  21. */
  22. class ErrorController extends AppController
  23. {
  24. /**
  25. * Initialization hook method.
  26. *
  27. * @return void
  28. */
  29. public function initialize()
  30. {
  31. parent::initialize();
  32. $this->loadComponent('RequestHandler', [
  33. 'enableBeforeRedirect' => false,
  34. ]);
  35. }
  36. /**
  37. * beforeFilter callback.
  38. *
  39. * @param \Cake\Event\Event $event Event.
  40. * @return \Cake\Http\Response|null|void
  41. */
  42. public function beforeFilter(Event $event)
  43. {
  44. }
  45. /**
  46. * beforeRender callback.
  47. *
  48. * @param \Cake\Event\Event $event Event.
  49. * @return \Cake\Http\Response|null|void
  50. */
  51. public function beforeRender(Event $event)
  52. {
  53. parent::beforeRender($event);
  54. $this->viewBuilder()->setTemplatePath('Error');
  55. }
  56. /**
  57. * afterFilter callback.
  58. *
  59. * @param \Cake\Event\Event $event Event.
  60. * @return \Cake\Http\Response|null|void
  61. */
  62. public function afterFilter(Event $event)
  63. {
  64. }
  65. }