| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 | 
							- <?php
 
- // +----------------------------------------------------------------------
 
- // | ThinkPHP [ WE CAN DO IT JUST THINK ]
 
- // +----------------------------------------------------------------------
 
- // | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
 
- // +----------------------------------------------------------------------
 
- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
 
- // +----------------------------------------------------------------------
 
- // | Author: liu21st <liu21st@gmail.com>
 
- // +----------------------------------------------------------------------
 
- use think\facade\Route;
 
- use app\common\model\Category;
 
- use think\facade\Template;
 
- Route::pattern([
 
-     'name' => '\w+',
 
-     'id' => '\d+',
 
-     'cid' => '\d+',
 
-     'page' => '\d+',
 
-     'year' => '\d+',
 
-     'month' => '\d+',
 
-     'day' => '\d+',
 
- ]); 
 
- Route::get('/index', 'index/index/index');
 
- Route::get('/', 'index/index/index');
 
- Route::view('/404', '404');
 
- Route::get('/about', 'index/index/about')->append(['_aside' => true]);
 
- Route::get('/guest_book', 'index/index/guestBook');
 
- Route::post('/save_guest_book', 'index/index/saveGuestBook');
 
- Route::get('/tags/:name', 'index/article/tags');
 
- Route::get('/time-<page?>', 'index/article/time')->append(['_aside' => true]);
 
- Route::get('/all-<page?>', 'index/article/index')->append(['cid' => 0]);
 
- Route::post('/dolike', 'index/article/dolike');
 
- Route::get('/:year/<month>-<day>/:id', 'index/article/read');
 
- Route::get('/:year/<month>-<page?>', 'index/article/archive');
 
- $list = Category::getList();
 
- foreach ($list as $key => $value) {
 
-     if ($value->template == 'article') {
 
-         Route::get($value->route . '-<page?>', 'index/article/index')->append(['cid' => $value->id]);
 
-     }
 
- }
 
 
  |