2017 © Pedro Peláez
 

library gravatar

Gravatar url builder

image

pespantelis/gravatar

Gravatar url builder

  • Monday, June 22, 2015
  • by pespantelis
  • Repository
  • 1 Watchers
  • 4 Stars
  • 130 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 2 Versions
  • 2 % Grown

The README.md

Gravatar

Gravatar is a service for providing globally unique avatars., (*1)

Installation

Begin by installing this package through Composer., (*2)

composer require pespantelis/gravatar

Usage

Create and initialize a gravatar url builder.

<?php

// require the Gravatar autoloader
require 'vendor/autoload.php';

// set options (optional)
$options = [
  'size' => 256,
  'default-image' => 'identicon',
  'force-default' => false,
  'rating' => 'pg',
  'secure' => true
];

$gravatar = new Peslis\Gravatar\Factory($options);

Generate a Gravatar url for the requested email.

echo $gravatar->url('pespantelis@gmail.com');

Check if the requested email has an associated image.

echo $gravatar->exists('pespantelis@gmail.com');
// or
echo $gravatar->url('pespantelis@gmail.com')->exists();

Override the options.

// size
echo $gravatar->url('pespantelis@gmail.com', 256);
// or
echo $gravatar->url('pespantelis@gmail.com')->size(256);

// secure requests
echo $gravatar->url('pespantelis@gmail.com')->secure();

// default image
echo $gravatar->url('pespantelis@gmail.com')->defaultImage('identicon');

// force default image
echo $gravatar->url('pespantelis@gmail.com')->forceDefault();

// rating level
echo $gravatar->url('pespantelis@gmail.com')->rating('pg');

Method chaining to set options.

echo $gravatar->url('pespantelis@gmail.com', 256)->defaultImage('identicon')->rating('pg');

Laravel Extension

If you are a Laravel user, there is a README.md here., (*3)

License

Gravatar is released under the MIT Licence. See the bundled LICENSE file for details., (*4)

The Versions

22/06 2015

dev-master

9999999-dev

Gravatar url builder

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Pantelis Peslis

laravel gravatar identicon

22/06 2015

1.0.0

1.0.0.0

Gravatar url builder

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Pantelis Peslis

laravel gravatar identicon