-
web.php路由中传递参数Route::get('req', function () { // Json 参数 $data = ['name'=>'dzm']; // 传递 return view('index')->with(['data'=>$data]); }); -
blade.php中使用<body> @if (isset($data['id'])) 有ID数据 @elseif (isset($data['name'])) 有Names数据 @else 无数据 @endif </body> -
Demo 效果