Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexeevdv/yii2-gravatar-widget
Gravatar widget for Yii2
https://github.com/alexeevdv/yii2-gravatar-widget
Last synced: about 2 months ago
JSON representation
Gravatar widget for Yii2
- Host: GitHub
- URL: https://github.com/alexeevdv/yii2-gravatar-widget
- Owner: alexeevdv
- License: mit
- Created: 2015-09-22T09:28:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-03-15T23:19:09.000Z (almost 6 years ago)
- Last Synced: 2024-10-23T12:23:56.615Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
yii2-gravatar-widget
====================[![Build Status](https://travis-ci.com/alexeevdv/yii2-gravatar-widget.svg?branch=master)](https://travis-ci.com/alexeevdv/yii2-gravatar-widget)
[![codecov](https://codecov.io/gh/alexeevdv/yii2-gravatar-widget/branch/master/graph/badge.svg)](https://codecov.io/gh/alexeevdv/yii2-gravatar-widget)
![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)
![PHP 7.2](https://img.shields.io/badge/PHP-7.3-green.svg)Yii2 wrapper for [Gravatar](https://gravatar.com) service.
## Installation
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
$ php composer.phar require alexeevdv/yii2-gravatar-widget
```or add
```
"alexeevdv/yii2-gravatar-widget": "^1.0"
```to the ```require``` section of your `composer.json` file.
## Usage
```php
echo \alexeevdv\yii\gravatar\Widget([
"email" => "[email protected]", // required
]);
```## Params
```php
/**
* User email address
*/
string $email;/**
* Use HTTPS connection?
*/
bool $secure = true;/**
* Append .jpg extension?
*/
bool $extension = true;/**
* Avatar width and height. Must be beetween 1 and 2048
*/
integer $size;/**
* Default image if avatar is not available. Must be valid image URI or one of the following strings:
* "404", "mm", "identicon", "monsterid", "wavatar", "retro", "blank"
*/
string $defaultImage;/**
* Force default image even if the avatar is available?
*/
bool $forceDefault = false;/**
* Allowed avatar rating. Must be one of the following strings:
* "g", "pg", "r", "x"
*/
string $rating;/**
* Additional HTML attributes to img tag
*/
array $options = [];```
For more information see [Gravatar manual](https://ru.gravatar.com/site/implement/).