Skip to content

Latest commit

 

History

History
57 lines (33 loc) · 1.17 KB

README.md

File metadata and controls

57 lines (33 loc) · 1.17 KB

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('[email protected]') }}

Or:

{{ '[email protected]'|gravatar }}

With parameters:

{{ gravatar('[email protected]', 96, 'g', 'retro', false) }}

Or:

{{ '[email protected]'|gravatar(96, 'g', 'retro', false) }}

Credits

License

The GravatarExtension is licensed under the MIT license.

More information