CakeErrorController.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * Error Handling Controller
  4. *
  5. * Controller used by ErrorHandler to render error views.
  6. *
  7. * PHP 5
  8. *
  9. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  10. * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
  11. *
  12. * Licensed under The MIT License
  13. * Redistributions of files must retain the above copyright notice.
  14. *
  15. * @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
  16. * @link http://cakephp.org CakePHP(tm) Project
  17. * @package Cake.Controller
  18. * @since CakePHP(tm) v 2.0
  19. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  20. */
  21. class CakeErrorController extends AppController {
  22. /**
  23. * Controller name
  24. *
  25. * @var string
  26. */
  27. public $name = 'CakeError';
  28. /**
  29. * Uses Property
  30. *
  31. * @var array
  32. */
  33. public $uses = array();
  34. /**
  35. * __construct
  36. *
  37. * @param CakeRequest $request
  38. * @param CakeResponse $response
  39. */
  40. public function __construct($request = null, $response = null) {
  41. parent::__construct($request, $response);
  42. $this->constructClasses();
  43. $this->Components->trigger('initialize', array(&$this));
  44. $this->_set(array('cacheAction' => false, 'viewPath' => 'Errors'));
  45. }
  46. /**
  47. * Escapes the viewVars.
  48. *
  49. * @return void
  50. */
  51. public function beforeRender() {
  52. parent::beforeRender();
  53. foreach ($this->viewVars as $key => $value) {
  54. if (!is_object($value)){
  55. $this->viewVars[$key] = h($value);
  56. }
  57. }
  58. }
  59. }