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
];
}
Nu găsiți un film sau un serial? Autentificați-vă pentru a-l crea.
Doriți să evaluați sau să adăugați acest articol într-o listă?
Nu sunteți membru?
Răspuns de Travis Bell
pe data de 20 ianuarie 2017 la ora 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...