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 2.0.0
13: * @license https://opensource.org/licenses/mit-license.php MIT License
14: */
15: namespace Cake\Controller;
16:
17: use Cake\Event\Event;
18:
19: /**
20: * Error Handling Controller
21: *
22: * Controller used by ErrorHandler to render error views.
23: */
24: class ErrorController extends Controller
25: {
26:
27: /**
28: * Initialization hook method.
29: *
30: * @return void
31: */
32: public function initialize()
33: {
34: $this->loadComponent('RequestHandler');
35: }
36:
37: /**
38: * beforeRender callback.
39: *
40: * @param \Cake\Event\Event $event Event.
41: * @return void
42: */
43: public function beforeRender(Event $event)
44: {
45: $this->viewBuilder()->setTemplatePath('Error');
46: }
47: }
48: