Skip to content

Kappa-org/Gravatar-Helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kappa\Gravata Build Status

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">

About

Simple system for getting avatars from service gravatar.com

Resources

License

Stars

Watchers

Forks

Packages

No packages published