ErrorController.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. * Redistributions of files must retain the above copyright notice.
  8. *
  9. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  10. * @link https://cakephp.org CakePHP(tm) Project
  11. * @since 3.7.0
  12. * @license https://opensource.org/licenses/mit-license.php MIT License
  13. */
  14. namespace TestApp\Controller\Admin;
  15. use Cake\Controller\Controller;
  16. use Cake\Event\Event;
  17. /**
  18. * Error Handling Controller
  19. *
  20. * Controller used by ErrorHandler to render error views.
  21. */
  22. class ErrorController extends Controller
  23. {
  24. /**
  25. * Initialization hook method.
  26. *
  27. * @return void
  28. */
  29. public function initialize()
  30. {
  31. $this->loadComponent('RequestHandler');
  32. }
  33. /**
  34. * beforeRender callback.
  35. *
  36. * @param \Cake\Event\Event $event Event.
  37. * @return void
  38. */
  39. public function beforeRender(Event $event)
  40. {
  41. $this->viewBuilder()->setTemplatePath('Error');
  42. }
  43. }