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
];
}
Não consegue encontrar um certo filme ou série? Inicie sessão e adicione-o.
Deseja classificar ou adicionar este item a uma lista?
Ainda não é um membro?
Resposta de Travis Bell
em 20 janeiro 2017 às 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...