This is a php library that creates badges like and and , according to Shields specification.
This library is used by https://poser.pugx.org
- PHP 7.4 or higher
- GD extension
to use the library with lower php version use the tag v1.4
$ composer create-project badges/poser
$ ln -s poser/bin/poser /usr/local/bin/poser
Create an image
$ poser license MIT blue -p "license.svg"
Flush an image
$ poser license MIT blue
$ composer require badges/poser
use PUGX\Poser\Render\SvgPlasticRender;
use PUGX\Poser\Poser;
$render = new SvgPlasticRender();
$poser = new Poser($render);
echo $poser->generate('license', 'MIT', '428F7E', 'plastic');
// or
echo $poser->generateFromURI('license-MIT-428F7E.svg?style=plastic');
// or
echo $poser->generateFromURI('license-MIT-428F7E?style=plastic');
// or
$image = $poser->generate('license', 'MIT', '428F7E', 'plastic');
echo $image->getStyle();
The allowed styles are: plastic
, flat
and flat-square
.
Dashes --
→ -
Dash
Underscores __
→ _
Underscore
_
or Space → Space
For more info please see the behat features and the examples in the php-spec folder
Not only because all the other languages already have it, but having the latest stable release in the readme could save time.
Active contribution and patches are very welcome.
Please refer to CONTRIBUTING