PHP Класс Phalcon\Avatar\Gravatar

This component provides an easy way to retrieve a user's profile image from Gravatar site based on a given email address. If the email address cannot be matched with a Gravatar account, an alternative will be returned based on the Gravatar::$defaultImage setting. Users with gravatars can have a default image if you want to.
Наследование: implements Phalcon\Avatar\Avatarable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( $config )
disableForceDefault ( ) : Gravatar Disable forces default image
disableSecureURL ( ) : Gravatar Disable the use of the secure protocol for image URLs
enableForceDefault ( ) : Gravatar Forces Gravatar to display default image
enableSecureURL ( ) : Gravatar Enable the use of the secure protocol for image URLs
getAvatar ( string $identity ) : string
getDefaultImage ( ) : mixed
getEmailHash ( string $email ) : string Get the email hash to use
getRating ( ) : integer Get the current maximum allowed rating for avatars
getSize ( ) : integer
isUseForceDefault ( ) : boolean Check if need to force the default image to always load
isUseSecureURL ( ) : boolean Check if we are using the secure protocol for the image URLs
setDefaultImage ( mixed $image ) : Gravatar
setRating ( string $rating ) : Gravatar Set the maximum allowed rating for avatars
setSize ( integer $size ) : Gravatar

Защищенные методы

Метод Описание
buildURL ( string $email ) : string Build the Gravatar URL based on the configuration and provided email address

Описание методов

__construct() публичный метод

public __construct ( $config )

buildURL() защищенный метод

Build the Gravatar URL based on the configuration and provided email address
protected buildURL ( string $email ) : string
$email string The email to get the gravatar for
Результат string

disableForceDefault() публичный метод

Disable forces default image
public disableForceDefault ( ) : Gravatar
Результат Gravatar

disableSecureURL() публичный метод

Disable the use of the secure protocol for image URLs
public disableSecureURL ( ) : Gravatar
Результат Gravatar

enableForceDefault() публичный метод

Forces Gravatar to display default image
public enableForceDefault ( ) : Gravatar
Результат Gravatar

enableSecureURL() публичный метод

Enable the use of the secure protocol for image URLs
public enableSecureURL ( ) : Gravatar
Результат Gravatar

getAvatar() публичный метод

public getAvatar ( string $identity ) : string
$identity string The email to get the gravatar for
Результат string

getDefaultImage() публичный метод

public getDefaultImage ( ) : mixed
Результат mixed

getEmailHash() публичный метод

Get the email hash to use
public getEmailHash ( string $email ) : string
$email string The email to get the hash for
Результат string

getRating() публичный метод

The string representing the current maximum allowed rating ('g', 'pg', 'r', 'x').
public getRating ( ) : integer
Результат integer

getSize() публичный метод

public getSize ( ) : integer
Результат integer

isUseForceDefault() публичный метод

Check if need to force the default image to always load
public isUseForceDefault ( ) : boolean
Результат boolean

isUseSecureURL() публичный метод

Check if we are using the secure protocol for the image URLs
public isUseSecureURL ( ) : boolean
Результат boolean

setDefaultImage() публичный метод

Possible $image formats: - a string specifying a recognized gravatar "default" - a string containing a valid image URL - boolean false for the gravatar default
public setDefaultImage ( mixed $image ) : Gravatar
$image mixed The default image to use
Результат Gravatar

setRating() публичный метод

Set the maximum allowed rating for avatars
public setRating ( string $rating ) : Gravatar
$rating string The maximum rating to use for avatars ('g', 'pg', 'r', 'x')
Результат Gravatar

setSize() публичный метод

By default, images from Gravatar.com will be returned as 80x80px
public setSize ( integer $size ) : Gravatar
$size integer The avatar size to use
Результат Gravatar