Welcome Guest, Not a member yet? Register   Sign In
Passing variable to view results in empty variable
#5

It sounds like the issue lies in passing the data to the view. You might want to try passing the data as an array with a key, like this:


return view('family', ['data' => $data]);
Then in the view, you can access the data array using the 'data' key:

php
<?php

if (empty($data))
{
echo 'Empty';
} else {

print_r($data);
}

?>
This should allow you to access the data array in the view and display the data.
Reply


Messages In This Thread
RE: Passing variable to view results in empty variable - by KeroniMasingolir - 03-22-2023, 12:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB