laravel compact() and ->with()

后端 未结 7 1396
梦谈多话
梦谈多话 2020-11-30 07:17

I have a piece of code and I\'m trying to find out why one variation works and the other doesn\'t.

return View::make(\'gameworlds.mygame\', compact(\'fixture         


        
7条回答
  •  有刺的猬
    2020-11-30 08:14

    Laravel Framework 5.6.26

    return more than one array then we use compact('array1', 'array2', 'array3', ...) to return view.

    viewblade is the frontend (view) blade.

    return view('viewblade', compact('view1','view2','view3','view4'));
    

提交回复
热议问题