我想仅将具有两个字段的表单的一个字段的值作为路由参数用于控制器。到目前为止,我所获得的仅仅是一些附加到url的查询字符串参数。如何将表单数据作为路由参数传递给Laravel 5.2
我的形式:
{{ Form::open(['route' => ['anuncio.especificar_tipo_imovel', $valorCep = 'valorCEp'], 'method' => 'GET']) }}
<input type="hidden" value="14405024" id="valorCep" name="valorCep"/>
<label for="tbCep"/>
<input autocomplete="off" id="tbCep" style="width:400px;" name="cep" type="text" />
</label>
<input type="submit" value="continuar">
{{ Form::close() }}
我有这样的路线:
Route::get('anuncio/especificar_tipo_imovel/{valorCep}', [
'as' => 'anuncio.especificar_tipo_imovel',
'uses' => '[email protected]_tipo_imovel'
]);
像这样
public function especificar_tipo_imovel(Request $request, $valorCep)
{
return view('especificar_tipo_imovel');
}
我要发送的值操作方法是价值隐藏字段:valorCep 我想要一个网址,如 http://my_route/34834839
数字是隐藏字段的值和$valorCep
路由参数。
我的网址是这样的:
http://my_route/valorCEp?valorCep=14405024&cep=Rua++jardim+pedreiras14405024
$ XXXX = $请求 - > valorCep;你可以像这样使用 – Sona
我的问题是不能获取控制器中的值。我的问题是网址格式。 –
对不起,没有得到你想要的? – Sona