kappa / gravatar-helper
Simple class for better getting avatars from service gravatar.com
v1.0.0
2014-05-21 21:12 UTC
Requires
- php: >= 5.3.3
- kappa/filesystem: ~4.2
- kappa/utils: ~1.0
- nette/nette: ~2.1
Requires (Dev)
- kappa/tester: 1.1.*
This package is auto-updated.
Last update: 2024-11-04 19:22:38 UTC
README
Simple class for better getting avatars from service gravatar.com
Requirements:
- PHP 5.3.3 or higher
- nette/nette 2.1.* and 2.2.*
- kappa/filesystem 4.2.*
- kappa/utils 1.0.*
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">