I have this object query out from mongodb
object(stdClass)#22 (9) {
["_id"]=>
object(MongoDB\BSON\ObjectID)#19 (1) {
["oid"]=>
string(24) "56639b2aa18994f5398b4567"
}
["Title"]=>
string(76) "Example movie ..."
["ID"]=>
string(10) "abc12345"
["Code"]=>
string(8) "123456"
["Released"]=>
string(10) "2015-11-27"
["Length"]=>
string(10) "300 min(s)"
["Poster"]=>
string(64) "http://example.net/84orea005pl.jpg"
["Episodes"]=>
object(stdClass)#21 (1) {
[1]=>
object(stdClass)#20 (1) {
["URL"]=>
string(38) "http://example.net/movie.e1.m3u8"
}
}
["View"]=>
int(31)
}
render by twig
twig->render('movie.html',array('movie' => $movie));
I can access to Title, ID ... easily by doing {{ movie.Title }}, {{ movie.ID }} ... However when I use for loop to loop through movie.Episodes I can't seem to get anything out of it.
{{ dump(movie.Episodes) }}
return
object(stdClass)#21 (1) {
[1]=>
object(stdClass)#20 (1) {
["URL"]=>
string(38) "http://example.net/movie.e1.m3u8"
}
}
but
{% for episode in movie.Episodes %}
testing
{{ dump(episode) }}
{% endfor %}
return empty and it doesn't even loop. So, my question is how can I get the movie episode URL out using twig?