CakeErrorController.php 908 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Error Handling Controller
  4. *
  5. * Controller used by ErrorHandler to render error views.
  6. *
  7. * @package Cake.Controller
  8. */
  9. class CakeErrorController extends AppController {
  10. public $name = 'CakeError';
  11. /**
  12. * Uses Property
  13. *
  14. * @var array
  15. */
  16. public $uses = array();
  17. /**
  18. * __construct
  19. *
  20. * @param CakeRequest $request
  21. * @param CakeResponse $response
  22. * @return void
  23. */
  24. public function __construct($request = null, $response = null) {
  25. parent::__construct($request, $response);
  26. $this->constructClasses();
  27. $this->Components->trigger('initialize', array(&$this));
  28. $this->_set(array('cacheAction' => false, 'viewPath' => 'Errors'));
  29. }
  30. /**
  31. * Escapes the viewVars.
  32. *
  33. * @return void
  34. */
  35. public function beforeRender() {
  36. parent::beforeRender();
  37. foreach ($this->viewVars as $key => $value) {
  38. if (!is_object($value)){
  39. $this->viewVars[$key] = h($value);
  40. }
  41. }
  42. }
  43. }