Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/pyrrah/gravatarbundle

Pyrrah Gravatar Bundle for Symfony 4.4 to 7
https://github.com/pyrrah/gravatarbundle

php symfony-bundle symfony4 symfony5 symfony6 symfony7

Last synced: about 1 month ago
JSON representation

Pyrrah Gravatar Bundle for Symfony 4.4 to 7

Awesome Lists containing this project

README

        

Pyrrah/GravatarBundle 🤳
========================

[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE)
[![Total Contributors][ico-contributors]][link-contributors]
[![Total Downloads][ico-downloads]][link-downloads]

This bundle allows you to display your avatar anywhere on your site, via the Gravatar service.

Requirements
------------

* Symfony 4.4 to 7
* PHP 7.1.3 or higher
* A [Gravatar account][link-gravatar-signup] - it's free!

Installation
------------

1. To install this bundle, run the following [Composer](https://getcomposer.org/) command :

```
composer require pyrrah/gravatar-bundle
```

2. If you always have some default for your gravatars such as size, rating or default it can be configured in your config :

```yaml
# config/packages/pyrrah_gravatar.yaml
pyrrah_gravatar:
rating: "g"
size: 80
default: "mp"
```

Usage
-----

All you have to do is use the helper like this example:

```html

```

Or with parameters:

```html

```

The only required parameter is the email adress. The rest have default values.

If you use twig you can use the helper like this example:

```

```

Or if you want to check if a gravatar email exists:

```
{% if gravatar_exists('[email protected]') %}
The email is an gravatar email
{% endif %}
```

Or with parameters:

```

```

For more information [look at the gravatar implementation pages][link-gravatar-implement].

Credits
-------

- [Pierre-Yves Dick][link-author]
- [All Contributors][link-contributors]

License
-------

The MIT License (MIT). Please see [License File](LICENSE) for more information.

[ico-version]: https://img.shields.io/packagist/v/pyrrah/gravatar-bundle.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-contributors]: https://img.shields.io/github/contributors/Pyrrah/GravatarBundle?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/pyrrah/gravatar-bundle.svg?style=flat-square

[link-packagist]: https://packagist.org/packages/pyrrah/gravatar-bundle
[link-downloads]: https://packagist.org/packages/pyrrah/gravatar-bundle
[link-author]: https://github.com/Pyrrah
[link-contributors]: ../../contributors
[link-gravatar-signup]: https://www.gravatar.com/site/signup
[link-gravatar-implement]: https://docs.gravatar.com/gravatar-images/php/