PHP code example of badges / poser
1. Go to this page and download the library: Download badges/poser library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
badges / poser example snippets
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();