gravatarphp/twig-integration 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gravatarphp/twig-integration

最新稳定版本:v2.0.0

Composer 安装命令:

composer require gravatarphp/twig-integration

包简介

Integrates Gravatar into Twig templating engine

README 文档

README

Latest Version Software License Build Status Total Downloads

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

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-31