How do I access the backdrop image in a foreach statement
foreach ($search as $result) {
$movies[] = [
'title' => $result->getTitle(),
'image' => $result->getPoster(),
'backdrop'=> $result->_data['backdrop'] // doesn't work because it's private
];
}
Can't find a movie or TV show? Login to create it.
Want to rate or add this item to a list?
Not a member?
Reply by Travis Bell
on januar 20, 2017 at 10:25 AM
Hi @kirkdm When you say "private" it sounds like you're talking about the method in whatever language you are using. And if I was to guess, you're using a library of a sort? If so, you should contact the developer of the library.
The backdrop is just a field like any other, the
backdrop_path
field.And looking at the first result...