PHP Class 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.
Inheritance: implements Phalcon\Avatar\Avatarable
Afficher le fichier Open project: phalcon/incubator Class Usage Examples

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
buildURL ( string $email ) : string Build the Gravatar URL based on the configuration and provided email address

Method Details

__construct() public méthode

public __construct ( $config )

buildURL() protected méthode

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
Résultat string

disableForceDefault() public méthode

Disable forces default image
public disableForceDefault ( ) : Gravatar
Résultat Gravatar

disableSecureURL() public méthode

Disable the use of the secure protocol for image URLs
public disableSecureURL ( ) : Gravatar
Résultat Gravatar

enableForceDefault() public méthode

Forces Gravatar to display default image
public enableForceDefault ( ) : Gravatar
Résultat Gravatar

enableSecureURL() public méthode

Enable the use of the secure protocol for image URLs
public enableSecureURL ( ) : Gravatar
Résultat Gravatar

getAvatar() public méthode

public getAvatar ( string $identity ) : string
$identity string The email to get the gravatar for
Résultat string

getDefaultImage() public méthode

public getDefaultImage ( ) : mixed
Résultat mixed

getEmailHash() public méthode

Get the email hash to use
public getEmailHash ( string $email ) : string
$email string The email to get the hash for
Résultat string

getRating() public méthode

The string representing the current maximum allowed rating ('g', 'pg', 'r', 'x').
public getRating ( ) : integer
Résultat integer

getSize() public méthode

public getSize ( ) : integer
Résultat integer

isUseForceDefault() public méthode

Check if need to force the default image to always load
public isUseForceDefault ( ) : boolean
Résultat boolean

isUseSecureURL() public méthode

Check if we are using the secure protocol for the image URLs
public isUseSecureURL ( ) : boolean
Résultat boolean

setDefaultImage() public méthode

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
Résultat Gravatar

setRating() public méthode

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')
Résultat Gravatar

setSize() public méthode

By default, images from Gravatar.com will be returned as 80x80px
public setSize ( integer $size ) : Gravatar
$size integer The avatar size to use
Résultat Gravatar