CakeErrorController.php 856 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Error Handling Controller
  4. *
  5. * Controller used by ErrorHandler to render error views.
  6. *
  7. * @package cake.libs
  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. * @access public
  21. * @return void
  22. */
  23. public function __construct($request = null, $response = null) {
  24. parent::__construct($request, $response);
  25. $this->constructClasses();
  26. $this->Components->trigger('initialize', array(&$this));
  27. $this->_set(array('cacheAction' => false, 'viewPath' => 'Errors'));
  28. }
  29. /**
  30. * Escapes the viewVars.
  31. *
  32. * @return void
  33. */
  34. public function beforeRender() {
  35. parent::beforeRender();
  36. foreach ($this->viewVars as $key => $value) {
  37. if (!is_object($value)){
  38. $this->viewVars[$key] = h($value);
  39. }
  40. }
  41. }
  42. }