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
];
}
Δεν μπορείτε να βρείτε κάποια ταινία ή σειρά; Συνδεθείτε για να τη δημιουργήσετε.
Θέλετε να αξιολογήσετε ή να προσθέσετε αυτό το στοιχείο σε μια λίστα;
Δεν είσαι μέλος;
Απάντηση από τον/την Travis Bell
στις 20 Ιανουάριος 2017 στις 10:25 ΕΊΜΑΙ
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...