Welcome Guest, Not a member yet? Register   Sign In
Integrate Zend Framework into CI
#1

[eluser]RaZoR LeGaCy[/eluser]
How can I do this?

I added the entire Zend Framework into the libraries folder then I tried to access it with

Controller
Code:
$this->load->library('zend');
$this->zend->load('Zend/Gdata/YouTube');

View
Code:
function getAndPrintVideoFeed($location = Zend_Gdata_YouTube::VIDEO_URI)
{
  $yt = new Zend_Gdata_YouTube();
  $videoFeed = $yt->getVideoFeed($location);
  printVideoFeed($videoFeed);
}

I did not config anything in Zend Framework and I don't think I am supposed to.

I am willing to try anything so all help is welcome.

Thanks
#2

[eluser]gunter[/eluser]
read here from our friend danfreak how he has done it:
http://www.4webby.com/freakauth/tutorial...de-igniter
#3

[eluser]Rick Jolly[/eluser]
Danfreak's example uses hooks which isn't necessary. I prefer something like this:
http://ellislab.com/forums/viewthread/72191/

Really though, it can be as simple as setting the include path to the location of your zend directory and require/include the zend class you want.
#4

[eluser]RaZoR LeGaCy[/eluser]
I now have another prob

I am able to pull data and interact with the Zend Framework but I do not know how to include images into my amazon api and youtube api.

I get the following on http://www.hellhorror.com/test

Controller
Code:
function index()
{
require_once 'Zend/Service/Amazon/Query.php';
$query = new Zend_Service_Amazon_Query('0G3339DN9PP84E2GKQ02');
$query->category('DVD')->Keywords('Horror');
$results = $query->search();
foreach ($results as $result) {
    echo $result->Title . '<br />';
    echo $result->ASIN . '<br />';
        }

echo '<br /><br /><br />';


$amazon = new Zend_Service_Amazon('0G3339DN9PP84E2GKQ02');
$results = $amazon->itemSearch(array('SearchIndex' => 'DVD', 'Keywords' => 'Horror', 'ResponseGroup' => 'Small,ItemAttributes,Images,SalesRank,Reviews,EditorialReview,Similarities,ListmaniaLists'));
$item = $amazon->itemLookup('B0000A432X');
foreach ($results as $result) {
    echo $result->Title . '<br />';
    echo $result->ASIN . '<br />';
}

echo '<br /><br /><br />';


require_once 'Zend/Service/Amazon.php';
$results = $amazon->itemSearch(array(
    'SearchIndex'   => 'Books',
    'Keywords'      => 'php',
    'ResponseGroup' => 'Small,ItemAttributes,Images,SalesRank,Reviews,EditorialReview,Similarities,ListmaniaLists'
    ));
foreach ($results as $result) {
    echo $result->Title . '<br />';
    echo $result->ASIN . '<br />';
    }


require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata_YouTube');

$yt = new Zend_Gdata_YouTube();
$query = $yt->newVideoQuery();
$query->category = 'Comedy/dog';

echo $query->queryUrl . "\n";
$videoFeed = $yt->getVideoFeed($query);

foreach ($videoFeed as $videoEntry) {
  echo "---------VIDEO----------\n";
  echo "Title: " . $videoEntry->mediaGroup->title->text . "\n";
  echo "\nDescription:\n";
  echo $videoEntry->mediaGroup->description->text;
  echo "<br /><br /><br />\n\n\n";
}

}

What am I not adding?
#5

[eluser]RaZoR LeGaCy[/eluser]
bump ...




Theme © iAndrew 2016 - Forum software by © MyBB