PHP code example of zeggriim / riot-api-datadragon

1. Go to this page and download the library: Download zeggriim/riot-api-datadragon 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/ */

    

zeggriim / riot-api-datadragon example snippets


// config/bundles.php
return [
    // Other Bundles
    Zeggriim\RiotApiDataDragon\RiotApiDataDragonBundle::class => ['all' => true],
];

    namespace App\Controller;
    
    use Symfony\Component\HttpFoundation\Response;
    use Symfony\Component\Routing\Annotation\Route;
    use Zeggriim\RiotApiDataDragon\Endpoint\DataDragon\VersionApiInterface;
    
    class HomeController
    {
        #[Route('/home', name: 'app_home')]
        public function index(VersionApiInterface $versionApi): Response
        {
            $versionApi->getVersions();
            // ['14.8.1','14.7.1','14.6.1','14.5.1','14.4.1'....]
        }
    }