Download the PHP package phalcon/incubator-avatar without Composer

On this page you can find all versions of the php package phalcon/incubator-avatar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

Please rate this library. Is it a good library?

All versions of incubator-avatar with dependencies

Informations about the package incubator-avatar

Phalcon\Incubator\Avatar

Discord Packagist Version PHP from Packagist codecov Packagist

Usage examples of the adapters available here:

Gravatar

Gravatar's are universal avatars available to all web sites and services. Users must register their email addresses with Gravatar before their avatars will be usable in your project.

Getting Started

Setup through setters

Setup through config

Using

Configuration

Gravatar size

Gravatar allows avatar images ranging from 0px to 2048px in size. With using 0px size, images from Gravatar will be returned as 80x80px.

Example:

If an invalid size (less than 0, greater than 2048) or a non-integer value is specified, this method will throw an exception of class \InvalidArgumentException.

Default Image

Gravatar provides several pre-fabricated default images for use when the email address provided does not have a gravatar or when the gravatar specified exceeds your maximum allowed content rating. In addition, you can also set your own default image to be used by providing a valid URL to the image you wish to use.

There are a few conditions which must be met for default image URL:

Possible values:

Example:

If an invalid default image is specified (both an invalid prefab default image and an invalid URL is provided), this method will throw an exception of class \InvalidArgumentException.

Using secure connection

Should we use the secure (HTTPS) URL base? If your site is served over HTTPS, you'll likely want to serve gravatars over HTTPS as well to avoid "mixed content warnings".

Example:

To check to see if you are using "secure images" mode, call the method Gravatar::isUseSecureURL(), which will return a boolean value regarding whether or not secure images mode is enabled.

Gravatar Rating

Gravatar provides four levels for rating avatars by, which are named similar to entertainment media ratings scales used in the United States.

Possible values:

By default, the Gravatar rating is Gravatar::RATING_G.

Example:

If an invalid maximum rating is specified, this method will throw an exception of class \InvalidArgumentException.

Force Default

If for some reason you wanted to force the default image to always load, you can enable or disable it.

Example:

To check to see if you are using "Force Default" mode, call the method Gravatar::isUseForceDefault(), which will return a boolean value.


Version
Requires php Version >=7.2
ext-phalcon Version ^4.0
ext-json Version *

The package phalcon/incubator-avatar contains the following files

Loading the files please wait ....