Skip to content

TheMovieDatabase datasource plugin for CakePHP

Notifications You must be signed in to change notification settings

cakephp-fr/the-movie-database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TheMovieDatabase plugin for CakePHP

Installation

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'
        ],
    ]

Usage

// 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

Resource

You can get your api key here.

For more information here.

About

TheMovieDatabase datasource plugin for CakePHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages