PHP code example of chipslays / tabus-api

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

    

chipslays / tabus-api example snippets


use Tabus\Client;

м токен (key) и актуальный домен.
$client = new Client('xxx', 'https://api1234567890.example.com');

// Опционально: кэшируем последущие запросы на 1 час.
$client->setCache(__DIR__ . '/cache', 3600);

// Получаем жанры.
$response = $client->api('genre');

// Выводим жанры со всех страниц.
while ($response = $response->getNextPage()) {
    $response->results->each(function ($item) {
        dump($item['name']);
    });
};