PHP code example of ilmala / tourney

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

    

ilmala / tourney example snippets


// Basic Loop 
foreach ($tournament->turns() as $turn) {
    echo "Turn {$turn->number()}<br>";
    foreach ($turn->games() as $game) {
        echo "{$game->description()}<br>";
    }
    echo "<br>";
}

$team = new \Tourney\Models\Team(
    name: 'Olimpia Milano',
    key: 'OM-01',
);

$team->name(); // The name of the Team
$team->key(); // Maybe a reference key of your application team model
 php
use Tourney\Tourney;

$teamNames = [
    'Bayern Monaco',
    'Olimpia Milano',
    'Partizan',
    'Virtus Bologna'
];

$tournament = (new Tourney())->generate(
    participants: $teams,
);