kappa/gravatar-helper

Simple class for better getting avatars from service gravatar.com

v1.0.0 2014-05-21 21:12 UTC

README

Simple class for better getting avatars from service gravatar.com

Requirements:

Installation

The best way to install Kappa\Utils is using Composer:

$ composer require kappa/gravatar:@dev

and register extension:

extensions:
    gravatar: Kappa\Gravatar\DI\GravatarExtension

Usages

You can set cache directory for faster displaying avatars

gravatar:
    cacheDir: %wwwDir%/gravatar #default

Into presenter or control where you can use this helper add filter (helper)

$template->addFilter('gravatar', array($this->gravatar, 'getAvatar')) // for Nette 2.2
$template->registerHelper('gravatar', array($this->gravatar, 'getAvatar')) // for Nette 2.1

Usages in template:

<img src="$user->getEmail()|gravatar:30">