RequestHandlerTestController.php 1.5 KB

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