A CakePhp Plugin that interacts with the API from themoviedb.org. The component will get/post data to/from the API and return an array to the controller. The helper will fetch the image from the API and save a local version for future use. Images cached from the API expire after 30 days and will be fetched again.
#Requirements#
*PHP 4,5
*CakePhp 2+
*TMDb API key
#Installation#
$ cd /your_CakePHP_root/
$ git submodule add git@github.com:mcred/CakePHP-TMDB-API-Plugin.git app/Plugin/Tmdb
#Configuration#
- Create an account at http://www.themoviedb.org/
- Obtain your API key
- Create a copy of tmdb.php to /app/Config/tmdb.php
- Insert your API Key and update any settings
- Edit your /app/Controller/AppController.php
class AppController extends Controller {
public $components = array('Tmdb.Tmdb');
public $helpers = array('Tmdb.Tmdb');
}
#Usage#
The general convention the the plugin follows matches the usage for the API. For a full list of functions, either see the component or read the list at http://docs.themoviedb.apiary.io/
Get /3/movie/{id} becomes
$this->Tmdb->getMovie($id,[$options]);
Get /3/movie/{id}/images becomes
$this->Tmdb->getMovieImages($id,[$options]);
#Example# Get Movie Information for your Controller
$movies = $this->Tmdb->getMovie(550,array('append_to_response'=>'trailers'));
debug($movies);
Display Movie Poster from your View
echo $this->Tmdb->GetMovieImage('/2lECpi35Hnbpa4y46JX0aY3AWTy.jpg','w342','Fight Club');
#Change History#
CakePHP TMDB v.1 - 2013-10-25
*Initial Committ