ViewPostsController.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  5. * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  6. *
  7. * Licensed under The MIT License
  8. * Redistributions of files must retain the above copyright notice.
  9. *
  10. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  11. * @link https://cakephp.org CakePHP(tm) Project
  12. * @since 3.0.0
  13. * @license https://opensource.org/licenses/mit-license.php MIT License
  14. */
  15. namespace TestApp\Controller;
  16. use Cake\Controller\Controller;
  17. class ViewPostsController extends Controller
  18. {
  19. /**
  20. * name property
  21. *
  22. * @var string
  23. */
  24. protected string $name = 'Posts';
  25. /**
  26. * index method
  27. *
  28. * @return void
  29. */
  30. public function index()
  31. {
  32. $this->set([
  33. 'testData' => 'Some test data',
  34. 'test2' => 'more data',
  35. 'test3' => 'even more data',
  36. ]);
  37. }
  38. /**
  39. * nocache_tags_with_element method
  40. *
  41. * @return void
  42. */
  43. public function nocache_multiple_element()
  44. {
  45. $this->set('foo', 'this is foo var');
  46. $this->set('bar', 'this is bar var');
  47. }
  48. }