Class GravatarHelper
Gravatar helper
Class to easily handle Gravatar image
-
Helper
-
AppHelper
-
GravatarHelper
Methods summary
public
|
#
__construct( array $options = array() )
Constructor to override self::$imageOptions
Constructor to override self::$imageOptions
Parameters
|
public
array
|
#
getImageOptions( array $options,… )
Get self::$imageOptions
Parameters
Returns
array
|
public
|
#
setImageOptions( array $options = array() )
Set self::$imageOptions
Parameters
|
public
string
|
#
imageUrl( string|array $user, array $options = array() )
Starting from user return the url of gravatar image
Starting from user return the url of gravatar image
Parameters
- $user
- an email or an array containing 'email' key
- $options
- override self::$imageOptions
Returns
string
|
public
string
|
#
image( string|array $user, array $options = array() )
Return a well formatted tag using gravatar image.
It can be configured with $options that can contain key to override self::imageOptions
- override of self::$imageOptions
- 'html' an array of HTML attribute to use in
Return a well formatted tag using gravatar image.
It can be configured with $options that can contain key to override self::imageOptions
- override of self::$imageOptions
- 'html' an array of HTML attribute to use in
Parameters
- $user
- an email or an array containing 'email' key
- $options
- image options
Returns
string
See
self::$imageOptions
|
private
[type]
|
#
userEmail( string|u $user )
Given a $user return an email
$user is expected to be a string (email) or an array with 'email' key
Given a $user return an email
$user is expected to be a string (email) or an array with 'email' key
Parameters
Returns
[type] [description]
|
Properties summary
public
array
|
$helpers
|
|
private
string
|
$imageEndpoint
|
#
'https://secure.gravatar.com/avatar/'
|
private
array
|
$imageOptions
Image options used in url query string
Image options used in url query string
- 'd' is the default image used if missing gravatar user image
- 's' the size of the image
See
https://it.gravatar.com/site/implement/images
|
#
array(
'd' => 'retro',
's' => null
)
|