TestsAppsController.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * TestsAppsController file
  4. *
  5. * PHP 5
  6. *
  7. * CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
  8. * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  9. *
  10. * Licensed under The MIT License
  11. * Redistributions of files must retain the above copyright notice
  12. *
  13. * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
  14. * @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests
  15. * @package Cake.Test.test_app.Controller
  16. * @since CakePHP(tm) v 1.2.0.4206
  17. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  18. */
  19. class TestsAppsController extends AppController {
  20. public $name = 'TestsApps';
  21. public $uses = array();
  22. public $components = array('RequestHandler');
  23. public function index() {
  24. $var = '';
  25. if (isset($this->request->query['var'])) {
  26. $var = $this->request->query['var'];
  27. }
  28. $this->set('var', $var);
  29. }
  30. public function some_method() {
  31. return 5;
  32. }
  33. public function set_action() {
  34. $this->set('var', 'string');
  35. $this->render('index');
  36. }
  37. public function redirect_to() {
  38. $this->redirect('http://cakephp.org');
  39. }
  40. }