//D:\LearnWebDevelop\php\thinkphp_5.0.5_full\application\route.php
return [
'blog/:year/:month' => ['blog/archive', ['method' => 'get'], ['year' => '\d{4}', 'month' => '\d{2}']],
'blog/:id' => ['blog/get', ['method' => 'get'], ['id' => '\d+']],
'blog/:name' => ['blog/read', ['method' => 'get'], ['name' => '\w+']],
 
<?php
//D:\LearnWebDevelop\php\thinkphp_5.0.5_full\application\index\controller\Blog.php
namespace app\index\controller;
class Blog
{
    //localhost/tp5/index.php/index/Blog/get/id/2
    //localhost/tp5/index.php/blog/2
    public function get($id)
    {
        return '查看id=' . $id . '的内容';
    }
    
    //localhost/tp5/index.php/index/Blog/read/name/Lucy
    //localhost/tp5/index.php/blog/Lily
    public function read($name)
    {
        return '查看name=' . $name . '的内容';
    }
    
    //localhost/tp5/index.php/index/Blog/archive/year/2017/month/12
    //localhost/tp5/index.php/blog/2017/12
    public function archive($year, $month)
    {
        return '查看' . $year . '/' . $month . '的归档内容';
    }
}