The Movie DB API Client for yii2
The preferred way to install this extension is through composer.
Either run
composer require --prefer-dist macklus/yii2-themdb "*"
or add
"macklus/yii2-themdb": "*"
to the require section of your composer.json
file.
Once the extension is installed, simply use it in your code by :
use macklus\themdb\Tmdbapi;
class SiteController extends Controller
{
public function actionTest()
{
$tmdb = new Tmdbapi();
$tmdb->api_key = '__INSERT_HERE_YOUR_API_KEY__';
if ($tmdb->getTvSeason(46952, 3, ['language' => 'es'])) {
print_R($tmdb->data);
} else {
echo 'error';
}
// Find something by his imdb_id
$tmdb->findByExternal('imdb_id', 'tt0816692', ['language' => 'es']);
}
}```
Comments