Laravel 控制器 怎么把一个function的id 用到另一个function里 5
publicfunctionassignlist($id1){//这个id1returnView::make('/manager/assignlist')->with('...
public function assignlist($id1){
// 这个id1
return View::make('/manager/assignlist')->with('volunteers', Volunteer::all());
}
public function updateassign($id2)
{
$volunteer = Volunteer::find($id2);
$volunteer->act_id = $id1;// 我想用到这里 怎么做到啊????
if($volunteer->save())
{
return Redirect::route('manager/assignlist',$volunteer->act_id );
}
return "There was an error";
} 展开
// 这个id1
return View::make('/manager/assignlist')->with('volunteers', Volunteer::all());
}
public function updateassign($id2)
{
$volunteer = Volunteer::find($id2);
$volunteer->act_id = $id1;// 我想用到这里 怎么做到啊????
if($volunteer->save())
{
return Redirect::route('manager/assignlist',$volunteer->act_id );
}
return "There was an error";
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询