PHP code example of team-reflex / paladins-api

1. Go to this page and download the library: Download team-reflex/paladins-api 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/ */

    

team-reflex / paladins-api example snippets


// Create api
$api = new Reflex\Paladins\API(DEV_ID, AUTH_KEY);

// optional session caching via many providers
// see https://github.com/onoi/cache/
$api->useCache(new \Onoi\Cache\ZendCache($zendCacheThing));
$api->useCache(new \Onoi\Cache\DoctrineCache($doctrineCacheThing));
$api->useCache(new \Onoi\Cache\MediaWikiCache(wfGetCache(CACHE_ANYTHING)));

// returns objects by default
$api->preferredFormat('array');
// will now return assoc arrays

// returns english language gods and item names by default
$api->preferredLanguage('es');
// use IETF language tag to select language
// (latin america becomes es-419)

// get player info
$playerData = $api->getplayer($playerName);

// get info on silver 3 ladder in season 4
$ladderData = $api->getleagueleaderboard('Conquest5v5', 'Silver3', 4);