GithubHelp home page GithubHelp logo

dolejska-daniel / bracket-generator Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 53 KB

Simple bracket generator for PHP7

License: GNU General Public License v3.0

PHP 97.15% CSS 2.85%
php brackets bracket-generator

bracket-generator's Introduction

PHP Bracket Generator

Version v0.2

Table of Contents

  1. Introduction
  2. Downloading
  3. Usage example

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.

The easiest way to get this library is to use Composer. 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 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.

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.

For more, please see the wiki pages.

bracket-generator's People

Contributors

dolejska-daniel avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

bracket-generator's Issues

How to fill match score

Hi daniel, awesome code and useful.

But how to fill score in every match?

I see you have function public function fillByMatchList()

~ Thank you ~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.