| 12345678910111213141516171819202122232425262728293031323334353637383940414243 | <?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('think', function () {    return 'hello,ThinkPHP6!';});Route::view('/404', '404');Route::get('/all', 'index/article/index');Route::get('/:year/:month/:day/:id', 'index/article/read');Route::post('/dolike', 'index/article/dolike');Route::get('/tags/:name', 'index/article/tags');Route::get('/time', 'index/article/time')->append(['_aside' => true]);Route::get('/about', 'index/index/about')->append(['_aside' => true]);$list = Category::getList();foreach ($list as $key => $value) {    if ($value->template == 'article') {        Route::get('/'.$value->url, 'index/article/index')->append(['cid' => $value->id]);    }}
 |