Skip to content

Usage example

Daniel Dolejška edited this page Jan 28, 2018 · 2 revisions

All it takes to create a bracket is this:

use BracketGenerator\Bracket;
echo Bracket::create(8);

And what will you end up with after this? Take a look:

Empty bracket for 8 participants

It looks a bit empty so you can fill it up very easily - let's start from the beginning:

use BracketGenerator\Bracket;

$bracket = Bracket::create(8);
$bracket->fillByParticipantList([
	[ 'Participant 1', 0 ],
	[ 'Participant 2', 0 ],
	[ 'Participant 3', 0 ],
	[ 'Participant 4', 0 ],
	[ 'Participant 5', 0 ],
	[ 'Participant 6', 0 ],
	[ 'Participant 7', 0 ],
	[ 'Participant 8', 0 ],
]);

echo $bracket;

And that gives us:

Filled bracket for 8 participants

Please remember that the bracket visuals are completly customizable. This is just an example.

Clone this wiki locally