PageRenderTime 40ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/library/XenForo/ControllerResponse/Redirect.php

https://github.com/hanguyenhuu/DTUI_201105
PHP | 72 lines | 13 code | 9 blank | 50 comment | 0 complexity | f3f65b36ecb7ffa66a0756547b95153a MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0, BSD-3-Clause
  1. <?php
  2. /**
  3. * Redirect controller response. This indicates that we want to externally redirect the user
  4. * to another page. Depending on the output type, this may not actually redirect. This may
  5. * tell the user that we created the resource and give them the URL.
  6. *
  7. * @package XenForo_Mvc
  8. */
  9. class XenForo_ControllerResponse_Redirect extends XenForo_ControllerResponse_Abstract
  10. {
  11. /**
  12. * Use this only when a resource has been newly created and the redirect target is
  13. * the URL to the new resource. If the user is being redirected anywhere else,
  14. * use {@link SUCCESS}.
  15. *
  16. * @var int
  17. */
  18. const RESOURCE_CREATED = 1;
  19. /**
  20. * Use this only when a resource has been updated and the redirect target is
  21. * the URL to the resource. If the user is being redirected anywhere else,
  22. * use {@link SUCCESS}.
  23. *
  24. * @var int
  25. */
  26. const RESOURCE_UPDATED = 2;
  27. /**
  28. * Use this when no resource has been updated and the redirect target is the
  29. * canonical version of the target URL. For example, this would be used when
  30. * redirecting the URL /thread/1/new-post to /thread/1/page2#post25.
  31. *
  32. * This should be used when the URL receiving the request may reasonably redirect
  33. * to different pages at different times (ie, temporary redirect). If this redirect
  34. * is likely to be permanent, use {@link RESOURCE_CANONICAL_PERMANENT}.
  35. *
  36. * @var int
  37. */
  38. const RESOURCE_CANONICAL = 3;
  39. /**
  40. * Use this when no resource has been updated and the redirect target is the
  41. * canonical version of the target URL. For example, this would be used when
  42. * redirecting the URL /post/25 to /thread/1#p25.
  43. *
  44. * This should only be used when there is no reasonable expectation that the redirect
  45. * target for a given request will vary (ie, permanent redirect). Otherwise, use
  46. * {@link RESOURCE_CANONICAL}.
  47. *
  48. * @var int
  49. */
  50. const RESOURCE_CANONICAL_PERMANENT = 5;
  51. /**
  52. * General purpose redirect for when an action has been successfully carried out.
  53. * This might be used when a resource has been created or updated but isn't
  54. * the redirect target.
  55. *
  56. * @var int
  57. */
  58. const SUCCESS = 4;
  59. public $redirectType = 4;
  60. public $redirectTarget = '';
  61. public $redirectMessage = '';
  62. public $redirectParams = array();
  63. }