Php 如何在url中获取id并将其显示在表单laravel 5中
我有一个href,它引导您访问addeditvisit/(所选行的id) 在我的表单中,我首先输入文本,而不是隐藏文本,以显示真正的值,并显示它Php 如何在url中获取id并将其显示在表单laravel 5中,php,laravel-5,Php,Laravel 5,我有一个href,它引导您访问addeditvisit/(所选行的id) 在我的表单中,我首先输入文本,而不是隐藏文本,以显示真正的值,并显示它 addeditvisit/5 我真正想要的是只得到5分。我应该使用什么功能?请帮帮我,我刚刚进入Laravel 5,仍在学习如果您愿意,您可以传递整个患者对象,如下所示: $patient = Patient::find($id); // get it from db, or some other data source return View
addeditvisit/5
我真正想要的是只得到5分。我应该使用什么功能?请帮帮我,我刚刚进入Laravel 5,仍在学习如果您愿意,您可以传递整个患者对象,如下所示:
$patient = Patient::find($id); // get it from db, or some other data source
return View::make('pages.addeditvisit', ['uri'=>$uri, 'patient' => $patient]);
`
然后在你的表格中,你可以使用
$patient->pID
或者,如果您只想获得以下信息,您可以传递id本身:
return View::make('pages.addeditvisit', ['uri'=>$uri, 'pID' => $patient->pID]);
如果需要,可以传递整个患者对象,如下所示:
$patient = Patient::find($id); // get it from db, or some other data source
return View::make('pages.addeditvisit', ['uri'=>$uri, 'patient' => $patient]);
`
然后在你的表格中,你可以使用
$patient->pID
或者,如果您只想获得以下信息,您可以传递id本身:
return View::make('pages.addeditvisit', ['uri'=>$uri, 'pID' => $patient->pID]);