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
];
}
Etkö löydä elokuvaa tai TV-ohjelmaa? Kirjaudu sisään lisätäksesi se.
Haluatko pisteyttää vai lisätä tämän nimikkeen listaan?
Ei rekisteröitynyt jäsen?
Vastaus käyttäjältä Travis Bell
20 tammikuu 2017 klo 10:25AM
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...