PHP code example of drmonkeyninja / cakephp-tmdb

1. Go to this page and download the library: Download drmonkeyninja/cakephp-tmdb library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

drmonkeyninja / cakephp-tmdb example snippets


Plugin::load('Muffin/Webservice');
Plugin::load('CakeTmdb');

'Webservices' => [
    'Tmdb' => [
        'className' => 'Muffin\Webservice\Connection',
        'service' => 'CakeTmdb\Lib\Tmdb\Driver\Tmdb',
        'api_key' => 'your_tmdb_api_key'
    ]
]

ConnectionManager::setConfig(Configure::consume('Webservices'));

$tmdb = \Cake\Datasource\ConnectionManager::get('Tmdb');
$data = $tmdb->getSearchApi()->searchMovies('Toy Story');

public $helpers = ['CakeTmdb.Tmdb'];

<?= $this->Tmdb->image($movie->poster, 'w154'); 

<?= $this->Tmdb->image($movie->poster, 'w154', ['alt' => $movie->title]);