Skip to content

redpanda/GravatarServiceProvider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

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('[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

About

Simple wrapper to gravatar API for Silex.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages