1
我有困难得到这个工作正常,可能有一个错误的方式,我想通过ID变量的方法。我正在使用Laravel。错误在PHP中:从空值创建默认对象
我的观点包含这种形式来处理函数并传递ID:
{{ Form::open(array('method' => 'GET', 'url' => array('uploads/edit', $upload->id))) }}
{{ Form::submit('Edit', array('class' => 'btn btn-info')) }}
{{ Form::close() }}
控制器:
public function getEdit($id)
{
$upload = $this->upload->find($id);
if (is_null($upload))
{
return Redirect::to('uploads/alluploads');
}
$layout->layout->content = View::make('uploads.edit', compact('upload'));
}
错误:
ErrorException
Creating default object from empty value