https://github.com/mcred/cakephp-tmdb-api-plugin
A CakePHP Plugin to interact with the TMDb API.
https://github.com/mcred/cakephp-tmdb-api-plugin
Last synced: about 1 year ago
JSON representation
A CakePHP Plugin to interact with the TMDb API.
- Host: GitHub
- URL: https://github.com/mcred/cakephp-tmdb-api-plugin
- Owner: mcred
- License: mit
- Created: 2013-10-26T17:21:07.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-01-26T05:20:41.000Z (over 12 years ago)
- Last Synced: 2025-02-02T02:16:48.627Z (over 1 year ago)
- Language: PHP
- Size: 133 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license.md
Awesome Lists containing this project
README
CakePHP-TMDB-API-Plugin
=======================
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#
1. Create an account at http://www.themoviedb.org/
2. Obtain your API key
3. Create a copy of tmdb.php to /app/Config/tmdb.php
4. Insert your API Key and update any settings
5. 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