0
如何在刀片模板中獲取分組路線?如何在刀片中獲取分組路線?
在PHP看起來像分組路線:
routes.php文件
...
//player section
Route::group(['prefix' => 'test'], function() {
Route::get('{slug}/{id}', [
'uses' => '[email protected]',
'as' => 'getTest',
]);
Route::get('{slug}/{id}/report', [
'middleware' => 'auth',
'uses' => '[email protected]',
'as' => 'reportTest',
]);
});
...
在刀片模板,我通過它得到一個途徑是'as'
串像
@if(Route::is('playTest'))
<!-- some html here -->
@endif
但我怎麼能在刀片模板中獲取按前綴'test'
分組的所有路由?
我想阻止寫所有的航線它的名字一樣:
(Route::is('getTest', 'reportTest'))
你使用'Route :: is'或'Request :: is'?我似乎無法在文檔中找到'Route :: is'。 – Samsquanch
@Samsquanch'Route :: is';) – herrh