Simple wrapper to gravatar API for Silex.
PHP
Switch branches/tags
Nothing to show
Pull request Compare This branch is 2 commits behind redpanda:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/Redpanda/Silex/Provider
LICENSE
README.md
composer.json

README.md

GravatarServiceProvider

A simple wrapper to gravatar API for Silex.

Installation

$ git submodule add git://github.com/redpanda/GravatarServiceProvider.git /path/to/vendor/service-provider/gravatar

Autoloader

$app['autoloader']->registerNamespace('Redpanda', /path/to/vendor/service-provider/gravatar/src');

Registering

$app->register(new Redpanda\Gravatar\Extension(), array(
    'gravatar.options' => array(
    	'size'    => 100,
    	'rating   => 'g',
    	'default' => 'mm',
    )
));

Usage with Twig

The only required parameter is the email adress. The rest have default values.

Without parameters:

{{ gravatar('jimmy.leger@gmail.com') }}

Or:

{{ 'jimmy.leger@gmail.com'|gravatar }}

With parameters:

{{ gravatar('jimmy.leger@gmail.com', 96, 'g', 'retro', false) }}

Or:

{{ 'jimmy.leger@gmail.com'|gravatar(96, 'g', 'retro', false) }}

Credits

License

The GravatarExtension is licensed under the MIT license.

More information