从查询字符串获取值

时间:2019-04-21 06:20:07

标签: laravel-blade laravel-5.8

http://localhost:3000/hospital/public/service/create?5 

我想获得创建页面输入值的5。

 <input type="number" name="patient_id" class="form-control" placeholder="ID" value=""> 

1 个答案:

答案 0 :(得分:0)

5悬在空中,我认为网址应为:

http://localhost:3000/hospital/public/service/create?patient_id=5 

然后

<input type="number" name="patient_id" class="form-control" placeholder="ID" value="<?= Input::get('patient_id'); ?>"> 

或任何php-bplade syntac。 <?= ?>可能不起作用