更新时间:2021-10-12 22:58:26
view()
函数只创建 View
类的实例。不只是一个HTML字符串。为此你应该调用 render()
:
The view()
function just creates an instance of the View
class. Not just an HTML string. For that you should call render()
:
$returnHTML = view('job.userjobs')->with('userjobs', $userjobs)->render();
return response()->json(array('success' => true, 'html'=>$returnHTML));