RequestHandlerTestController.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. * uses property
  26. *
  27. * @var mixed
  28. */
  29. public $uses = null;
  30. /**
  31. * test method for ajax redirection
  32. *
  33. * @return void
  34. */
  35. public function destination() {
  36. $this->viewPath = 'Posts';
  37. $this->render('index');
  38. }
  39. /**
  40. * test method for ajax redirection + parameter parsing
  41. *
  42. * @param string $one
  43. * @param string $two
  44. * @return void
  45. */
  46. public function param_method($one = null, $two = null) {
  47. echo "one: $one two: $two";
  48. $this->autoRender = false;
  49. }
  50. /**
  51. * test method for testing layout rendering when isAjax()
  52. *
  53. * @return void
  54. */
  55. public function ajax2_layout() {
  56. $this->layout = 'ajax2';
  57. $this->destination();
  58. }
  59. }