Download the PHP package drago-ex/gravatar without Composer
On this page you can find all versions of the php package drago-ex/gravatar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download drago-ex/gravatar
More information about drago-ex/gravatar
Files in drago-ex/gravatar
Package gravatar
Short Description Simple and customizable Gravatar integration for PHP applications, allowing easy Gravatar image generation based on user email with options for size, default image, and rating.
License MIT
Informations about the package gravatar
Drago Gravatar
Simple and customizable Gravatar integration for PHP applications.
Technology
- PHP 8.3 or higher
- composer
Installation
Overview
Drago Gravatar is a simple, customizable solution for integrating Gravatar images into your PHP application. With this package, you can easily generate and display Gravatar images based on user email addresses, allowing you to customize their size, default image, and rating.
Features
- Generate Gravatar images based on user email.
- Customizable image size (from 1 to 2048 pixels).
- Choose a default image if the user has no Gravatar.
- Set image rating (g, pg, r, x).
- Easy integration into your Nette-based application.
Extension registration
After installation, register the extension in your Nette configuration (neon
file):
You can adjust the size, defaultImage
, and rating parameters based on your needs.
Usage
Once the extension is registered, you can use the Gravatar functionality in your presenters and templates.
In Presenter
In your presenter, you can access the Gravatar service, set the user's email, and pass the generated Gravatar URL to the template:
In Template
In your Latte template, simply output the Gravatar image by using the URL provided by the presenter:
Customizing Gravatar
You can customize the Gravatar by changing the size, defaultImage, and rating parameters in the configuration:
size
: The size of the Gravatar image in pixels (1 to 2048). Default is 80.
defaultImage
: The default image used when the user doesn't have a Gravatar (e.g., mm
, identicon
, monsterid
, wavatar
, etc.). Default is mm
.
rating
: The rating of the Gravatar image (g
, pg
, r
, x
). Default is g.