路由::获取('报告/ {报告} /离开',[' as' =>' reports.leave','使用' =>' ReportController @ leave']);
@foreach($ dat as $ report)
<?php
$date=$_POST['date'];
$fdate=$_POST['fdate'];
?>
<td><a href="{{ URL::route('admin.reports.leave',$report->name,$fdate) }}">{!!$report->name!!}</td>
答案 0 :(得分:0)
要传递三个变量,您可以尝试以下示例代码:
路线:
Route::get('admin/{variable_1}/reports/{variable_2}/leave/{variable_3}', 'ReportController@leave');
控制器方法:
public function leave($variable_1, $variable_2, $variable_3){
}
HTML(刀片)链接:
<a href="{{ url('admin/'.$variable_1.'/reports/'.$variable_2.'/leave/'.$variable_3) }}">{!!$report->name!!}</a>
答案 1 :(得分:0)
尝试下面给出的代码:
<强>路线强>
Route::get('reports/{reports}/leave/{date}/{fdate}', [
'as'=> 'reportsLeave', 'uses' =>'ReportController@leave']);
<强>刀片强>
@foreach($dat as $report)
<?php
$date=$_POST['date'];
$fdate=$_POST['fdate'];
?><td><a href="{{ URL::route('reportsLeave',[$reports => $report->name, 'date' => $date, 'fdate' => $fdate) }}">{!!$report->name!!}</td>
<强>控制器强>
public function leave($reports, $date, $fdate){...}
希望以上建议的方式对你有用。运气最好!