Suporte do The Movie Database

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
    ];
}

1 resposta (na página 1 de 1)

Jump to last post

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.

https://api.themoviedb.org/3/search/movie?api_key=###&query=inception

And looking at the first result...

{
  "poster_path": "/qmDpIHrmpJINaRKAfWQfftjCdyi.jpg",
  "adult": false,
  "overview": "Cobb, a skilled thief who commits corporate espionage by infiltrating the subconscious of his targets is offered a chance to regain his old life as payment for a task considered to be impossible: \"inception\", the implantation of another person's idea into a target's subconscious.",
  "release_date": "2010-07-14",
  "genre_ids": [
    28,
    53,
    878,
    9648,
    12
  ],
  "id": 27205,
  "original_title": "Inception",
  "original_language": "en",
  "title": "Inception",
  "backdrop_path": "/s2bT29y0ngXxxu2IA8AOzzXTRhd.jpg",
  "popularity": 8.313062,
  "vote_count": 9924,
  "video": false,
  "vote_average": 8
}

Não consegue encontrar um certo filme ou série? Inicie sessão e adicione-o.

Geral

s focus the search bar
p abrir menu do perfil
esc close an open window
? open keyboard shortcut window

Em páginas de Média

b go back (or to parent when applicable)
e ir para a página de edição

Em páginas de temporadas de séries

(seta para a direita) ir para a próxima temporada
(seta para a esquerda) ir para a temporada anterior

Em Páginas de Episódios de Séries

(seta para a direita) ir para o próximo episódio
(seta para a esquerda) ir para o episódio anterior

Em Todas as Páginas de Imagens

a abrir janela para adicionar imagem

Em Todas as Páginas de Edição

t open translation selector
ctrl+ s submit form

Em Páginas de Discussão

n criar uma nova discussão
w toggle watching status
p toggle public/private
c toggle close/open
a abrir actividade
r reply to discussion
l ir para a última resposta
ctrl+ enter submit your message
(seta para a direita) página seguinte
(seta para a esquerda) página anterior

Definições

Deseja classificar ou adicionar este item a uma lista?

Iniciar Sessão

Ainda não é um membro?

Crie uma Conta e Adere a Comunidade