A simple wrapper to gravatar API for Silex.
$ git submodule add git://github.com/redpanda/GravatarServiceProvider.git /path/to/vendor/service-provider/gravatar
$app['autoloader']->registerNamespace('Redpanda', /path/to/vendor/service-provider/gravatar/src');
$app->register(new Redpanda\Gravatar\Extension(), array(
'gravatar.options' => array(
'size' => 100,
'rating' => 'g',
'default' => 'mm',
)
));
The only required parameter is the email adress. The rest have default values.
Without parameters:
{{ gravatar('[email protected]') }}
Or:
{{ '[email protected]'|gravatar }}
With parameters:
{{ gravatar('[email protected]', 96, 'g', 'retro', false) }}
Or:
{{ '[email protected]'|gravatar(96, 'g', 'retro', false) }}
The GravatarExtension is licensed under the MIT license.