# php_badge
**Repository Path**: shenshang/php_badge
## Basic Information
- **Project Name**: php_badge
- **Description**: :octocat: This is an identification tag based on SVG, It can quickly generate various labels and status identifiers
- **Primary Language**: PHP
- **License**: MPL-2.0
- **Default Branch**: main
- **Homepage**: https://github.com/yakeing/php_badge
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 1
- **Created**: 2020-11-09
- **Last Updated**: 2021-11-03
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Badge
This is an identification tag based on SVG, It can quickly generate various labels and status identifiers.
### v5.0.0 New version testing
The new border mode can also customize the border color, redesign and adjust the fillet of the badge to make it look more stereoscopic, and add new functions to optimize the program code.

```php
https://oauth.applinzi.com/Test/heart/color/555555.svg
```
### Sponsors Example
[](https://github.com/yakeing/Documentation/blob/master/Sponsor/README.md)
[](https://github.com/yakeing/Documentation/blob/master/Sponsor/README.md)
```php
$Badge->Icon = file_get_contents({LOGO}); //
array(
array({MESSAGE},{COLOR})
);
//test example
//https://oauth.applinzi.com/State/heart/Sponsor/EA4AAA.svg
```
---
### Hits Example

```php
//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

```php
//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





```php
//https://example.com/Label/{LOGO}/{MESSAGE}/{COLOR}.svg
//get logo file
$Badge->Icon = file_get_contents({LOGO}); //
$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
[](../../releases)
[](LICENSE)
[](src/Badge.php/)
[](../../)
[](../../search?l=php)
[](../../watchers)
[](../../stargazers)
[](../../network/members)
```php
//https://example.com/Label/{LABEL}/{MESSAGE}/{COLOR}.svg
$Badge->Icon = file_get_contents({LOGO}); //
array(
array({LABEL},'555555'),
array({MESSAGE},{COLOR})
);
//test example
//https://oauth.applinzi.com/Label/license/MPL-2.0/FE7D37.svg
```
---
### Travis CI badge
[](https://travis-ci.com/yakeing/php_badge)
### codecov badge
[](https://codecov.io/gh/yakeing/php_badge)
### Packagist badge
[](../../releases)
[](https://packagist.org/packages/yakeing/php_badge/stats)
### Github badge
[](../../)
[](src/Badge.php)
### Installation
Use [Composer](https://getcomposer.org) to install the library.
Of course, You can go to [Packagist](https://packagist.org/packages/yakeing/php_badge) to view.
```shell
$ composer require yakeing/php_badge
```
### Initialization parameter
- [x] Sample:
```php
$arr = array(
array('build', '555'), //#555555
array('passing', '4c1'), //#44CC11
..........
);
$Badge = new Badge();
$Badge->svg($arr);
```
[Sponsor](https://github.com/yakeing/Documentation/blob/master/Sponsor/README.md)
---
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.
[](https://github.com/yakeing/Documentation/blob/master/Sponsor/README.md)
Author
---
weibo: [yakeing](https://weibo.com/yakeing)
twitter: [yakeing](https://twitter.com/yakeing)