Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alexeevdv/twig-gravatar-filter

Twig filter that converts email to Gravatar image url.
https://github.com/alexeevdv/twig-gravatar-filter

Last synced: about 1 month ago
JSON representation

Twig filter that converts email to Gravatar image url.

Awesome Lists containing this project

README

        

# Twig Gravatar filter

[![Build Status](https://travis-ci.org/alexeevdv/twig-gravatar-filter.svg?branch=master)](https://travis-ci.org/alexeevdv/twig-gravatar-filter)
[![codecov](https://codecov.io/gh/alexeevdv/twig-gravatar-filter/branch/master/graph/badge.svg)](https://codecov.io/gh/alexeevdv/twig-gravatar-filter)
![PHP 5.6](https://img.shields.io/badge/PHP-5.6-green.svg)
![PHP 7.0](https://img.shields.io/badge/PHP-7.0-green.svg)
![PHP 7.1](https://img.shields.io/badge/PHP-7.1-green.svg)
![PHP 7.2](https://img.shields.io/badge/PHP-7.2-green.svg)

This is Twig filter which converts email to Gravatar image url.

## Installation

The preferred way to install this extension is through [composer](https://getcomposer.org/download/).

Either run

```bash
$ composer require alexeevdv/twig-gravatar-filter "^1.0"
```

or add

```
"alexeevdv/twig-gravatar-filter": "^1.0"
```

to the ```require``` section of your `composer.json` file.

## Configuration

### Symfony

```
twig.extension.gravatar:
class: \alexeevdv\twig\GravatarFilter
tags:
- { name: twig.extension }
```

### Standalone

```php
$twig->addExtension(new \alexeevdv\twig\GravatarFilter);
```

## Usage

### Without parameters

```html


```

### With different parameters

```html


```

## Parameters

For possible values please refer to [Gravatar documentation](https://en.gravatar.com/site/implement/images/)