PHP code example of janiv / shelf

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

    

janiv / shelf example snippets




nt = Shelf\Client::factory();

// Getting a single game
$response = $client->getBoardgame(
    array('id' => 13)
);
$game = $response->getBoardgame();

echo '<p>' . $game->getPrimaryName()->getValue() . '</p>';


// Getting a collection of games
$response = $client->getBoardgames(
    array('id' => array(12, 13, 34119))
);
$games = $response->getBoardgames();
foreach ($games as $game) {
    echo '<p>' . $game->getPrimaryName()->getValue() . '</p>';
}