2

如何从命名路由中删除索引?

路线

<?php

Route::group(array('prefix' => 'reports/finance'), function () {
    Route::controller('/', 'Reports\Finance\HomeController', ['getIndex' => 'reports.finance']);
});

看法

{{ HTML::linkRoute('reports.finance', 'admin', ['captial-admin']) }}

生成的网址

/reports/finance/index/captial-admin

我想要的是...

/reports/finance/captial-admin
4

2 回答 2

0

Can you check the 'url' of your app/config/app.php if there is 'index' there?

于 2013-06-06T11:34:48.547 回答
0

您可以在路线定义中更加明确。

Route::group(['prefix' => 'foo'], function(){
    Route::get('bar/baz', ['uses' => 'SomeController@getIndex', 'as' => 'route.name']);
});

节拍编辑核心。

于 2013-06-17T06:09:17.337 回答