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