app.php 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <<<<<<< HEAD
  2. <?php
  3. // +----------------------------------------------------------------------
  4. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  5. // +----------------------------------------------------------------------
  6. // | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
  7. // +----------------------------------------------------------------------
  8. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  9. // +----------------------------------------------------------------------
  10. // | Author: liu21st <liu21st@gmail.com>
  11. // +----------------------------------------------------------------------
  12. use think\facade\Route;
  13. use app\common\model\Category;
  14. use think\facade\Template;
  15. Route::pattern([
  16. 'name' => '\w+',
  17. 'id' => '\d+',
  18. 'cid' => '\d+',
  19. 'page' => '\d+',
  20. 'year' => '\d+',
  21. 'month' => '\d+',
  22. 'day' => '\d+',
  23. ]);
  24. Route::get('/index', 'index/index/index');
  25. Route::get('/', 'index/index/index');
  26. Route::view('/404', '404');
  27. Route::get('/about', 'index/index/about')->append(['_aside' => true]);
  28. Route::get('/guest_book', 'index/index/guestBook');
  29. Route::post('/save_guest_book', 'index/index/saveGuestBook');
  30. Route::get('/tags/:name', 'index/article/tags');
  31. Route::get('/all-<page?>', 'index/article/index')->append(['cid' => 0]);
  32. Route::post('/dolike', 'index/article/dolike');
  33. Route::get('/:year/<month>-<day>/:id', 'index/article/read');
  34. Route::get('/:year/<month>-<page?>', 'index/article/archive');
  35. $list = Category::getList();
  36. foreach ($list as $key => $value) {
  37. Route::get($value->url . '-<page?>', $value->route)->append(['cid' => $value->id]);
  38. }
  39. =======
  40. <?php
  41. // +----------------------------------------------------------------------
  42. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  43. // +----------------------------------------------------------------------
  44. // | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
  45. // +----------------------------------------------------------------------
  46. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  47. // +----------------------------------------------------------------------
  48. // | Author: liu21st <liu21st@gmail.com>
  49. // +----------------------------------------------------------------------
  50. use think\facade\Route;
  51. use app\common\model\Category;
  52. use think\facade\Template;
  53. Route::pattern([
  54. 'name' => '\w+',
  55. 'id' => '\d+',
  56. 'cid' => '\d+',
  57. 'page' => '\d+',
  58. 'year' => '\d+',
  59. 'month' => '\d+',
  60. 'day' => '\d+',
  61. ]);
  62. Route::get('/index', 'index/index/index');
  63. Route::get('/', 'index/index/index');
  64. Route::view('/404', '404');
  65. Route::get('/about', 'index/index/about')->append(['_aside' => true]);
  66. Route::get('/guest_book', 'index/index/guestBook');
  67. Route::post('/save_guest_book', 'index/index/saveGuestBook');
  68. Route::get('/tags/:name', 'index/article/tag');
  69. Route::get('/tag/:name', 'index/article/tag');
  70. Route::get('/all-<page?>', 'index/article/index')->append(['cid' => 0]);
  71. Route::post('/dolike', 'index/article/dolike');
  72. Route::get('/:year/<month>-<day>/:id', 'index/article/read');
  73. Route::get('/:year/<month>-<page?>', 'index/article/archive');
  74. $list = Category::getList();
  75. foreach ($list as $key => $value) {
  76. Route::get($value->url . '-<page?>', $value->route)->append(['cid' => $value->id]);
  77. }
  78. >>>>>>> 78b76253c8ce5873016cf837373af5e30ac80c86