SomePostsController.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. * @since 3.0.0
  12. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  13. */
  14. namespace TestApp\Controller;
  15. use Cake\Controller\Controller;
  16. use Cake\Event\Event;
  17. /**
  18. * SomePostsController class
  19. *
  20. */
  21. class SomePostsController extends Controller {
  22. /**
  23. * uses property
  24. *
  25. * @var array
  26. */
  27. public $uses = array();
  28. /**
  29. * autoRender property
  30. *
  31. * @var bool
  32. */
  33. public $autoRender = false;
  34. /**
  35. * beforeFilter method
  36. *
  37. * @param Event $event
  38. * @return void
  39. */
  40. public function beforeFilter(Event $event) {
  41. if ($this->request->params['action'] === 'index') {
  42. $this->request->params['action'] = 'view';
  43. } else {
  44. $this->request->params['action'] = 'change';
  45. }
  46. $this->request->params['pass'] = array('changed');
  47. }
  48. /**
  49. * index method
  50. *
  51. * @return void
  52. */
  53. public function index() {
  54. }
  55. /**
  56. * change method
  57. *
  58. * @return void
  59. */
  60. public function change() {
  61. }
  62. }