So I went over this thread to figure out how to send data from controller to a view here.
However I am trying to pass multiple values with identical titles to the view and I cannot seem to figure out how to do this and still access them later.
I have a for loop that grabs all the films a user has in their database, this information is then stored into a array called $data
$data = array();
foreach ($films as $film)
{
$title = $film->title;
$description = $film->description;
$url = $film->fileUrl;
$data = array_add($data, 'title', $title);
$data = array_add($data, 'description', $description);
$data = array_add($data, 'url', $url);
}
$this->layout->content = View::make('profileFilms')->with($data);
This works but I cannot figure out how to access this information, I tried making each "film" its own array with all three data values and then adding that to the larger array and then passing that array to the view, which again worked but I cannot figure out how to access the data. if i use say {{$title}} it will grab one title, but I have no way of getting both.
How can I pass N number of films each with its title, description and url to a view so I can display them, and how can I display them?