4.1.2 • Published 6 years ago

php-badge v4.1.2

Weekly downloads
-
License
MPL-2.0
Repository
github
Last release
6 years ago

Badge

This is an identification tag based on SVG, It can quickly generate various labels and status identifiers

Sponsors Example

Sponsor

    $Badge->Icon = file_get_contents({LOGO}); //<path d="M23....." fill="#FFF"></path>
    array(
     array({MESSAGE},{COLOR})
    );

    //test example
    //https://oauth.applinzi.com/State/heart/Sponsor/EA4AAA.svg

Hits Example

Hits

    //https://example.com/Hits/{USERNAME}/{PROJECT}/image.svg

    ++$count;
    array(
     array('hits','555555'),
     array($count,'4C1')
    );

    //test example
    //https://oauth.applinzi.com/Hits/yakeing/php_badge/image.svg

Server Example

Server

    //https://example.com/Server/{USERNAME}/{PROJECT}/image.svg

    array(
     array('{OS}','555555'),
     array('CPU: {CPU}','A0ABFC'),
     array('RAM: {RAM}','F0A010')
    );

    //test example
    //https://oauth.applinzi.com/Server/yakeing/index/image.svg

State Example

error Active PAGES thumb passed

    //https://example.com/Label/{LOGO}/{MESSAGE}/{COLOR}.svg

    //get logo file
    $Badge->Icon = file_get_contents({LOGO}); //<path d="M23....." fill="#FFF"></path>
    $Badge->viewBox = '-120 -85 1200 1200'; //Svg Icon x, y, Width, Height
    $Badge->opacity = 0.7; //transparency (0 - 1)

    array(
     array({MESSAGE},{COLOR})
    );

    //test example
    //https://oauth.applinzi.com/State/passed/PASSED/44CC11.svg

Label Example

tag license languages watch star fork

    //https://example.com/Label/{LABEL}/{MESSAGE}/{COLOR}.svg

    $Badge->Icon = file_get_contents({LOGO}); //<path d="M23....." fill="#FFF"></path>
    array(
     array({LABEL},'555555'),
     array({MESSAGE},{COLOR})
    );

    //test example
    //https://oauth.applinzi.com/Label/license/MPL-2.0/FE7D37.svg

Travis CI

Travis-ci

codecov

codecov

Packagist

Version Downloads

Github

Downloads Size

Installation

Use Composer to install the library.

    $ composer require yakeing/php_badge

Initialization parameter

  • Sample:
    $arr = array(
        array('build', '555'), //#555555
        array('passing', '4c1'), //#44CC11
        ..........
    );

    $Badge = new Badge();
    $Badge->svg($arr);

Sponsors

If you've got value from any of the content which I have created, then I would very much appreciate your support by payment donate.

Bitcoin

1FYbZECgs3V3zRx6P7yAu2nCDXP2DHpwt8

Bitcoin

WeChat

WeChat

Alipay

Alipay

Author

weibo: yakeing

twitter: yakeing

4.1.2

6 years ago

4.1.1

6 years ago

4.1.0

6 years ago