首頁  >  文章  >  後端開發  >  lumen 里路由的 Route::group 怎么用?

lumen 里路由的 Route::group 怎么用?

WBOY
WBOY原創
2016-06-06 20:29:132273瀏覽

http://lumen.laravel.com/docs/routing#route-groups

在 Namespaces 下有一段话:

<code class="php">$app->group(['namespace' => 'Admin'], function()
{
    // Controllers Within The "App\Http\Controllers\Admin" Namespace

    Route::group(['namespace' => 'User'], function()
    {
        // Controllers Within The "App\Http\Controllers\Admin\User" Namespace
    });
});</code>

Remember, by default, the RouteServiceProvider includes your routes.php file within a namespace group, allowing you to register controller routes without specifying the full App\Http\Controllers namespace prefix. So, we only need to specify the portion of the namespace that comes after the base App\Http\Controllers namespace root.

其中 RouteServiceProvider 这个文件的内容怎么写???

回复内容:

http://lumen.laravel.com/docs/routing#route-groups

在 Namespaces 下有一段话:

<code class="php">$app->group(['namespace' => 'Admin'], function()
{
    // Controllers Within The "App\Http\Controllers\Admin" Namespace

    Route::group(['namespace' => 'User'], function()
    {
        // Controllers Within The "App\Http\Controllers\Admin\User" Namespace
    });
});</code>

Remember, by default, the RouteServiceProvider includes your routes.php file within a namespace group, allowing you to register controller routes without specifying the full App\Http\Controllers namespace prefix. So, we only need to specify the portion of the namespace that comes after the base App\Http\Controllers namespace root.

其中 RouteServiceProvider 这个文件的内容怎么写???

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn