https://github.com/dolejska-daniel/bracket-generator
Simple bracket generator for PHP7
https://github.com/dolejska-daniel/bracket-generator
bracket-generator brackets php
Last synced: about 1 year ago
JSON representation
Simple bracket generator for PHP7
- Host: GitHub
- URL: https://github.com/dolejska-daniel/bracket-generator
- Owner: dolejska-daniel
- License: gpl-3.0
- Created: 2018-01-27T09:47:15.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-29T19:09:22.000Z (over 7 years ago)
- Last Synced: 2025-02-11T17:56:49.829Z (about 1 year ago)
- Topics: bracket-generator, brackets, php
- Language: PHP
- Size: 51.8 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# PHP Bracket Generator
> Version v0.2
# Table of Contents
1. [Introduction](#introduction)
2. [Downloading](#downloading)
3. [Usage example](#usage-example)
# [Introduction](https://github.com/dolejska-daniel/bracket-generator/wiki/Home#introduction)
Welcome to bracket generator for PHP7 repo. This library uses HTML tables to render nice and
clean game brackets. You can create brackets based on participant count, match list or even
custom tree. Bracket visuals are also completly customizable.
Please, refer mainly to the [wiki pages](https://github.com/dolejska-daniel/bracket-generator/wiki).
# [Downloading](https://github.com/dolejska-daniel/bracket-generator/wiki/Home#downloading)
The easiest way to get this library is to use [Composer](https://getcomposer.org/). While
having Composer installed it takes only `composer require dolejska-daniel/bracket-generator`
and `composer update` to get the library up and ready!
If you are not fan of Composer, you can download [whole repository in .zip archive](https://github.com/dolejska-daniel/bracket-generator/archive/master.zip)
or clone the repository using Git - `git clone https://github.com/dolejska-daniel/bracket-generator`.
_But in this case, you will have to create your own autoload function._
# [Usage example](https://github.com/dolejska-daniel/bracket-generator/wiki/Usage-example)
All it takes to create a bracket is this:
```php
use BracketGenerator\Bracket;
echo Bracket::create(8);
```
And what will you end up with after this? Take a look:

It looks a bit empty so you can fill it up very easily - let's start from the beginning:
```php
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:

Please remember that the bracket visuals are completly customizable. This is just an example.
For more, please see [the wiki pages](https://github.com/dolejska-daniel/bracket-generator/wiki/Usage-example).