1. 程式人生 > >ThinkPHP5.1 多級控制器路由

ThinkPHP5.1 多級控制器路由

路由地址中支援多級控制器

/home/myth/www/think/application/index/controller/group/Blog.php

<?php
namespace app\index\controller\group;

class Blog
{
    public function read($id)
    {
        return 'read:' . $id;
    }
}

/home/myth/www/think/route/route.php

Route::get('blog/:id','index/group.blog/read');  // http://contoso.org/blog/2233