Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
将多个结果绑定到视图的最佳方法是什么?以下不起作用,但它捕获了我的逻辑:
public function show($id) { $nests = Nest::with('user')->find($id); $notes = Note::with('nest')->where('nest_id', '=', $id); return View::make('nests.show', compact('nests', 'notes')); }
我认为这会做到:
return View::make('nests.show',array('nests'=>$nests,'notes'=>$notes));
我用了这段代码
return View::make('myviewfolder.myview', compact('view1','view2','viewN'));
我正在使用 PHP 5.5
这是有关紧凑功能的信息
PHP 紧凑函数