Hi Adrian,
Why do you believe the last line is not getting executed?
The following code works for me to print out the name of the videos.
Note: to get some of the data other than simple things like video titles will require navigating the extension elements. This might be a little difficult if you're new to PHP. We're working on adding specific support and samples for YouTube:
http://framework.zend.com/issues/browse/ZF-1918If you want to get the extension elements, call:
$extensions = $entry->getExtensionElements();
That'll give you an array of Zend_Gdata_App_Extension_Element objects:
http://framework.zend.com/apidoc/core/Zend_Gdata/Zend_Gdata_App_Extension_Element.html
<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_Query');
$gdata = new Zend_Gdata ();
$query = new Zend_Gdata_Query('
http://gdata.youtube.com/feeds/standardfeeds/top_rated');
$feed = $gdata->getFeed($query);
foreach ($feed as $entry) {
echo $entry->getTitle()->text . "<br />";
}
?>