PHP code example of dgunay / good-bans

1. Go to this page and download the library: Download dgunay/good-bans 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/ */

    

dgunay / good-bans example snippets




use GoodBans\OpGG;
use GoodBans\RiotChampions;
use GoodBans\ChampionsDatabase;

$db = new ChampionsDatabase(
	new \PDO('sqlite:/path/to/your_db.db'), // use whatever PDO you like
	new OpGG(),
	new RiotChampions()
);

$db->refresh(); // prepares the tables and fetches data from the interwebs!

	use GoodBans\ChampionsDatabase;
	use GoodBans\TopBans;
	use GoodBans\View;
	$bans = $db->topBans();
	$view = new View($bans);
	echo $view->render();