sqin / gravatar
Framework agnostic Gravatar library
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is auto-updated.
Last update: 2023-03-17 16:35:28 UTC
README
#Gravatar
##Description
The Gravatar package allows you to easily implement Gravatars in your application.
##Methods
###__construct()
Creates a Gravatar instance.
$gravatar = new Gravatar();
###factory()
Returns a Gravatar instance. Allows for method chaining right of the bat.
Gravatar::factory()->setSize(80)->getGravatar('user@example.org');
###setSize(int $size)
Set the size of the Gravatar. Value must be between 1 and 512.
$gravatar->setSize(100);
###getSize()
Returns the size of the Gravatar.
$gravatar->getSize();
###setRating(string $rating)
Set the max rating of the Gravatar.
$gravatar->setRating('pg');
###getRating()
Returns the rating of the Gravatar.
$gravatar->getRating();
###setDefault(string $default)
Set the url to the default Gravatar.
$gravatar->setDefault('http://example.org/default_avatar.png');
###getDefault()
Returns the urlencoded URL of the default Gravatar.
$gravatar->getDefault();
###getUrl(string $email)
Returns the URL of the Gravatar.
$gravatar->getUrl('user@example.org');
###getGravatar(string $email [, array $attributes = array()])
Returns Gravatar image tag.
$gravatar->getGravatar('user@example.org');