RequestHandlerTestController.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  4. *
  5. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  6. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  7. *
  8. * Licensed under The MIT License
  9. * For full copyright and license information, please see the LICENSE.txt
  10. * Redistributions of files must retain the above copyright notice.
  11. *
  12. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  13. * @link http://cakephp.org CakePHP(tm) Project
  14. * @since 3.0.0
  15. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  16. */
  17. namespace TestApp\Controller;
  18. use Cake\Controller\Controller;
  19. /**
  20. * RequestHandlerTestController class
  21. *
  22. */
  23. class RequestHandlerTestController extends Controller
  24. {
  25. /**
  26. * uses property
  27. *
  28. * @var mixed
  29. */
  30. public $uses = null;
  31. /**
  32. * test method for ajax redirection
  33. *
  34. * @return void
  35. */
  36. public function destination()
  37. {
  38. $this->viewPath = 'Posts';
  39. $this->render('index');
  40. }
  41. /**
  42. * test method for ajax redirection + parameter parsing
  43. *
  44. * @param string|null $one
  45. * @param string|null $two
  46. * @return void
  47. */
  48. public function param_method($one = null, $two = null)
  49. {
  50. echo "one: $one two: $two";
  51. $this->autoRender = false;
  52. }
  53. /**
  54. * test method for testing layout rendering when isAjax()
  55. *
  56. * @return void
  57. */
  58. public function ajax2_layout()
  59. {
  60. $this->layout = 'ajax2';
  61. $this->destination();
  62. }
  63. }