【发布时间】:2021-05-07 22:13:03
【问题描述】:
我正在尝试从 URL 获取值,例如:websitename.com/dash/namehere
我有路线:
Route::get('/dash/{id}', 'DashController@index' , function($id) {
return 'dash'.$id;
});
然后,我在尝试显示为标题的页面上有一个部分。我目前正在使用这个:
@if (\Request::is('dash/1'))
<div class="pagetitle">[clientname]</div>
@endif
这可行,但我认为有更好的方法来解决这个问题。我对此很陌生。 我想从 url /site.com/dash/ {id} 获取 id 并在 HTML 页面中将其用作 Title 标题。
【问题讨论】: