Base for a static organization website

RequestPanel.php 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  4. * Copyright (c) Cake Software Foundation, Inc. (http://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. (http://cakefoundation.org)
  10. * @link http://cakephp.org CakePHP(tm) Project
  11. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  12. */
  13. App::uses('DebugPanel', 'DebugKit.Lib');
  14. /**
  15. * Provides debug information on the Current request params.
  16. *
  17. */
  18. class RequestPanel extends DebugPanel {
  19. /**
  20. * beforeRender callback - grabs request params
  21. *
  22. * @param Controller $controller
  23. * @return array
  24. */
  25. public function beforeRender(Controller $controller) {
  26. $out = array();
  27. $out['params'] = $controller->request->params;
  28. $out['url'] = $controller->request->url;
  29. $out['query'] = $controller->request->query;
  30. $out['data'] = $controller->request->data;
  31. if (isset($controller->Cookie)) {
  32. $out['cookie'] = $controller->Cookie->read();
  33. }
  34. $out['get'] = $_GET;
  35. $out['currentRoute'] = Router::currentRoute();
  36. return $out;
  37. }
  38. }