You can install this plugin into your CakePHP application using composer.
The recommended way to install composer packages is:
composer require cakephp-fr/the-movie-database
Before you can do any request you need set information :
// in config/app.php
'Datasources' => [
// other datasources
'theMovieDatabase' => [
'className' => 'TheMovieDatabase\Datasource\Connection',
'driver' => 'TheMovieDatabase\Datasource\Connection',
'apiKey' => '************',
'lang' => 'fr'
],
]
// in your controller
use Cake\Datasource\ConnectionManager;
class MyController extends AppController {
public function index() {
$conn = ConnectionManager::get('theMovieDatabase'); // get the connection
$tvShow = $conn->searchTv('supernatural'); // execute a query
debug($tvShow); // watch the result
}
}
Watch source Datasource/Connection.php for other query
You can get your api key here.
For more information here.