gravatarphp/twig-integration
最新稳定版本:v2.0.0
Composer 安装命令:
composer require gravatarphp/twig-integration
包简介
Integrates Gravatar into Twig templating engine
关键字:
README 文档
README
Integrates Gravatar into Twig templating engine.
Install
Via Composer
$ composer require gravatarphp/twig-integration
Usage
use Gravatar\Gravatar; use Gravatar\Twig\GravatarExtension; $extension = new GravatarExtension(new Gravatar()); $environment->addExtension($extension);
Use it in a twig template:
<a href="{{ 'user@domain.com'|gravatar_avatar }}">Avatar</a> <a href="{{ 'user@domain.com'|gravatar_profile }}">Profile</a> <a href="{{ 'user@domain.com'|gravatar_vcard }}">vCard</a> <a href="{{ 'user@domain.com'|gravatar_qrCode }}">QR Code</a>
Options can be provided as first filter parameter, for example:
<a href="{{ 'user@domain.com'|gravatar_avatar({d: 'retro'}) }}">Avatar</a>
All options can be found on Gravatar's documentation.
Testing
$ composer test
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 383
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-01-31