route.inc.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. use Cas\Dao\LotteryEvents;
  3. /**
  4. * !!!!!
  5. * !! 限制:
  6. * !! 1、不要出现()号的嵌套,不支持!
  7. * !! 2、括号外不要出现正则相关字符,如 ? ^等
  8. * !!!!!
  9. * 路由配置
  10. */
  11. function getEventsC(){
  12. $eventRoute = LotteryEvents::getEventRoute();
  13. preg_match('/([a-zA-Z]+)\/([0-9]+)([a-zA-Z]+)/iU',$_SERVER['PHP_SELF'],$eventArr);
  14. return $eventRoute[$eventArr['3']];
  15. }
  16. return array(
  17. 'test' => array(
  18. 'c' => 'Test',
  19. ),
  20. 'admin' => array(
  21. 'c' => 'Admin_Index',
  22. 'a' => $_GET['a'],
  23. ),
  24. 'services/([a-zA-Z]+)/?' => array(
  25. 'c' => 'services',
  26. 'a' => '$1',
  27. ),
  28. '([a-zA-Z]+)/([0-9]+)([a-zA-Z])/share?' => array(
  29. 'c' => getEventsC(),
  30. 'url' =>'$1',
  31. 'create_time' =>'$2',
  32. 'type' => 'share',
  33. ),
  34. '([a-zA-Z]+)/([0-9]+)([a-zA-Z])/share/([0-9]+)?' => array(
  35. 'c' => getEventsC(),
  36. 'url' =>'$1',
  37. 'create_time' =>'$2',
  38. 'type' => 'share',
  39. 'source_user' => '$3',
  40. ),
  41. '([a-zA-Z]+)/([0-9]+)([a-zA-Z])/prize?' => array(
  42. 'c' => getEventsC(),
  43. 'url' =>'$1',
  44. 'create_time' =>'$2',
  45. 'type' => 'prize',
  46. ),
  47. '([a-zA-Z]+)/([0-9]+)([a-zA-Z])/feedback?' => array(
  48. 'c' => getEventsC(),
  49. 'url' =>'$1',
  50. 'create_time' =>'$2',
  51. 'type' => 'feedback',
  52. ),
  53. '([a-zA-Z]+)/([0-9]+)([a-zA-Z])?' => array(
  54. 'c' => getEventsC(),
  55. 'url' =>'$1',
  56. 'create_time' =>'$2',
  57. ),
  58. '([a-zA-Z]+)/([a-zA-Z]+)/([0-9]+)?' => array(
  59. 'c' => '$2',
  60. 'url' =>'$1',
  61. 'create_time' =>'$3',
  62. ),
  63. 'connect(?:/([a-z]+))?/?' => array(
  64. 'c' => 'connect',
  65. 'a' => '$1',
  66. ),
  67. 'article/v([a-z]+)g/?' => array(
  68. 'c' => 'article',
  69. 'friendlyUrl' => '$1',
  70. ),
  71. 'list/([a-zA-Z]+)/member/([a-zA-Z]+)/?' => array(
  72. 'c' => 'member',
  73. 'url' =>'$1',
  74. 'a' => '$2',
  75. ),
  76. 'tryDetail/([0-9]+)/?' => array(
  77. 'c' => 'tryDetail',
  78. 'tryid' => '$1',
  79. ),
  80. 'redirect/?' => array(
  81. 'c' => 'redirect',
  82. ),
  83. 'API_SetUser_([a-zA-Z]+)' => array(
  84. 'c' => 'API_SetUser',
  85. 'a' =>'$1',
  86. ),
  87. 'list/([a-zA-Z]+)/?' => array(
  88. 'c' => 'Index',
  89. 'url' =>'$1',
  90. ),
  91. # 新增分类列表页
  92. 'cate/([0-9]+)/([a-zA-Z]+)/?' => array(
  93. 'c' => 'Cate',
  94. 'cate' =>'$1',
  95. 'url' =>'$2',
  96. ),
  97. 'SetUser/?' => array(
  98. 'c' => 'API_SetUser',
  99. 'a' =>'page',
  100. ),
  101. );