route.inc.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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])/help?' => array(
  54. 'c' => getEventsC(),
  55. 'url' =>'$1',
  56. 'create_time' =>'$2',
  57. 'type' => 'help',
  58. ),
  59. '([a-zA-Z]+)/([0-9]+)([a-zA-Z])?' => array(
  60. 'c' => getEventsC(),
  61. 'url' =>'$1',
  62. 'create_time' =>'$2',
  63. ),
  64. '([a-zA-Z]+)/([a-zA-Z]+)/([0-9]+)?' => array(
  65. 'c' => '$2',
  66. 'url' =>'$1',
  67. 'create_time' =>'$3',
  68. ),
  69. 'connect(?:/([a-z]+))?/?' => array(
  70. 'c' => 'connect',
  71. 'a' => '$1',
  72. ),
  73. 'article/v([a-z]+)g/?' => array(
  74. 'c' => 'article',
  75. 'friendlyUrl' => '$1',
  76. ),
  77. 'list/([a-zA-Z]+)/member/([a-zA-Z]+)/?' => array(
  78. 'c' => 'member',
  79. 'url' =>'$1',
  80. 'a' => '$2',
  81. ),
  82. 'tryDetail/([0-9]+)/?' => array(
  83. 'c' => 'tryDetail',
  84. 'tryid' => '$1',
  85. ),
  86. 'redirect/?' => array(
  87. 'c' => 'redirect',
  88. ),
  89. 'API_SetUser_([a-zA-Z]+)' => array(
  90. 'c' => 'API_SetUser',
  91. 'a' =>'$1',
  92. ),
  93. 'list/([a-zA-Z]+)/?' => array(
  94. 'c' => 'Index',
  95. 'url' =>'$1',
  96. ),
  97. # 新增分类列表页
  98. 'cate/([0-9]+)/([a-zA-Z]+)/?' => array(
  99. 'c' => 'Cate',
  100. 'cate' =>'$1',
  101. 'url' =>'$2',
  102. ),
  103. 'SetUser/?' => array(
  104. 'c' => 'API_SetUser',
  105. 'a' =>'page',
  106. ),
  107. );