nubox/standard-card-deck

There is no license information available for the latest version (dev-master) of this package.

simple functions for displaying standard card decks

dev-master 2023-08-21 20:23 UTC

This package is auto-updated.

Last update: 2024-04-21 22:07:08 UTC


README

Introduction

This small composer package helps to render playing cards via HTML.

img.png

Installation

Install through composer

{
    "require" : {
        "nubox/standard-card-deck" : "*"
    }
}

Usage

Draw a card by a simple string

include 'vendor/autoload.php';

echo drawCard('4 Karo');
echo drawCard('10 Herz');

Generating a card deck, take a card from the deck and draw it (OOP Style)

$deck = new \NuBox\StandardCardDeck\Model\Deck();

// or

$deck = \NuBox\StandardCardDeck\Singleton\DeckSingleton::getInstance()->getDeck();

echo drawCard($deck->takeCard());