Yii 1.1: eimdbquery

A wrapper for IMDB API on http://www.imdbapi.com
3 followers

A wrapper for IMDB API on http://www.imdbapi.com.

Requirements

  • Yii 1.1.
  • CURL or fopen enabled in server.

Usage

  • Download the extension and extract it to your extension directory.
  • Just follow the following example:
<?php
    // Load the extension
    Yii::import("ext.EImdbQuery.EImdbQuery");
 
    // Create the object
    $movie = new EImdbQuery($model->Title, EImdbQuery::TYPE_TITLE);
 
    // Get data as a property, or
    $movie->Title
 
    // Get data as a method
    $movie->getTitle();
 
        // Alternatively, to do a search.
    $movie = new EImdbQuery($model->Title, EImdbQuery::TYPE_TITLE, false); // set last parameter to false, which defines to do a less strict search
 
    $movie->Greedy = true; // set to true to get all complete results for each movie
 
    // Get results
    for($i=0;$i<$movie->getCount();$i++)
    {
        // Get data as a method
        $movie->getTitle($i);
    }
 
    // Get data as a property
    $movie->Title_0
?>

Available Data

  • Title
  • Year
  • Rated
  • Released
  • Runtime
  • Genre
  • Director
  • Writer
  • Actors
  • Plot
  • Poster
  • imdbRating
  • imdbVotes
  • imdbID
  • Response

Contact

Any bugs or suggestions could be delivered to me through bS.xx7_37@yahoo.com.

Be the first person to leave a comment

Please to leave your comment.

Create extension