Php 如何在Laravel中将多个变量从视图传递到控制器?
我想将表单数据从视图传递到控制器内的函数。有什么方法可以做到这一点?简单地说: 在视图中:Php 如何在Laravel中将多个变量从视图传递到控制器?,php,laravel,model-view-controller,Php,Laravel,Model View Controller,我想将表单数据从视图传递到控制器内的函数。有什么方法可以做到这一点?简单地说: 在视图中: { Form::open(array('action' => 'Controller@method')) }} {{ Form::text('rate', '', array('placeholder' => 'Enter new custom client rate...')) }} {{ Form::submit('Submit', array('class' =>
{ Form::open(array('action' => 'Controller@method')) }}
{{ Form::text('rate', '', array('placeholder' => 'Enter new custom client rate...')) }}
{{ Form::submit('Submit', array('class' => 'btn btn-primary')) }}
{{ Form::close() }}
在您的控制器中:
class Controller extends BaseController {
public function method()
{
// get the rate value
$rate = Input::get('rate');
or
// to get all form values
$allFormValues = Input::all();
}
}
就这样
Laravel足够聪明,可以获取所有这些请求值。href=“{{route('getentry',[$entry->filename])}”,但我无法让它在多个变量的情况下工作