-
Pass parameters in the web.php route
Route: : get (' the req ', function () {/ / Json parameter $data = [' name '= >' DZM]; / / pass the return view (' index ') - > with ([' data '= > $data]); });Copy the code
-
Blade. Use in PHP
$data['id']) @elseif ($data['name']) @elseif ($data['name']) @endif </body>Copy the code
-
Effect of the Demo