1

我要吓坏了,因为我试图让“编辑用户”表单运行,但我一直收到这个错误:

Collective\Html\FormBuilder::input() 缺少参数 2,在第 217 行的 D:\Apache24\htdocs\monitor\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php 中调用并定义(查看: D:\Apache24\htdocs\monitor\resources\views\user\edit.blade.php)

这就是我的 edit.blade.php-View 中的调用:

{{ Form::model($user, array('route' => array('User.edit', $user->id), 'method' => 'PUT')) }}

{{ Form::input('email') }}
{{ Form::input('name') }}

{{ Form::close() }

那是我在“用户控制器”中的“编辑”方法

public function edit($id)
{
    $user = User::find($id);
    return view('user.edit', compact('user'));   //
}

我还没有“更新”功能。只是试图获得模型形式。

4

1 回答 1

1

错误说你需要使用两个参数:第一个是输入的类型,第二个参数是表单元素的名称:

{{ Form::input('text', 'name') }}
于 2016-08-08T07:32:42.820 回答