[英]how to get parameters in url laravel view or blade
My question code is below,我的问题代码如下,
{{ route('report.edit', array('id' => $report->uid, 'p_'.$param->name => $param->value, 'p_'.$param->name => $param->value))}}">
Output is: https://laracast.com/report/12/edit?p_paramname=paramvalue
Output 是:
https://laracast.com/report/12/edit?p_paramname=paramvalue
But i have multiple parameters name and value, its not taking only last paramname and value is taking.但是我有多个参数名称和值,它不只采用最后一个参数名称和值。 If you print {{$param->name}} getting 2 param values.
如果你打印 {{$param->name}} 得到 2 个参数值。
That is just because you have the same keys那只是因为你有相同的钥匙
Look at this看这个
'p_'.$param->name => $param->value, 'p_'.$param->name => $param->value
Just use the separate keys and this will fix your problem只需使用单独的键,这将解决您的问题
For example Look at this例如看这个
'p_1_'.$param->name => $param->value, 'p_2_'.$param->name => $param->value
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.