Get started
We will guide you through the simple Installation process (not sure if this can be even called installation, because of how simple it is)
Requirements
- PHP 5.4 or higher (Versions tested: 8.0, 8.1 -other versions may also work)
- The GD extension installed (most PHP installations have this by default)
- (Optional: A cup of coffee ☕️)
Alternatively you could use my publicly hosted version of PHP-BADGES, but I would recommend hosting it yourself, as it is very simple to do so.
Installation Steps
- Download the latest release from the Releases page.
- Extract the zip file and upload the
generate.php
from thesrc
folder to your web server. - You're done! 🎉
Whats next?
Basic Usage
First Visit
When you first visit the generate.php
file in your browser, the font will be automatically downloaded for you.
To create a badge, simply add open the generate.php
file in your browser.
By default, the badge will be created with the following settings:
- Icon: GitHub
- Label: Documentation
- Message: go.jm26.net/badge-docs
- Color: green
(Instructions for changing the default settings can be found here)
Creating a Badge
I recommend using the Badge Generator to create your badges, as it is much easier to use.
Otherwise to generate a badge with different settings, simply add the following query parameters to the URL:
icon
- The icon to use, Font Awesome icon unicode (e.g.f09b
for GitHub). See Icons for more info.label
- The label text (left side) of the badgemessage
- The message text (right side) of the badgecolor
- The color of the badge (e.g.green
,red
, ok, important, ff69b4, etc.)- (optional)
url
- The URL to an external json file to get the badge settings from (see External JSON for more info)
Examples (quality was reduced due to the image being resized)
-
Standard Badge
https://api.jm26.net/badge?g&label=Label&message=Message&color=blue
-
Badge with Icon
https://api.jm26.net/badge?g&label=Label&message=Message&color=important&icon=f09b
-
BETA FEATURE!
https://api.jm26.net/badge/beta?url=https://shields.io/github/stars/jmcrafter26/php-badges.json&color=FFDB2D&label=Stars
(See External JSON for more info)More Examples
For more examples, please refer to the Usage page.
Made with ❤️ by JMcrafter26
Enjoying PHP-BADGES? Show some love by liking and sharing this repository or support me by buying me a coffee ☕