Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Simple wrapper to gravatar API for Silex.

Resources

Code of conduct

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages