954. Class

954.1. Zend\View\Helper\Gravatar

Helper for retrieving avatars from gravatar.com

954.1.1. Methods

954.1.1.1. __invoke

__invoke()

Returns an avatar from gravatar’s service.

$options may include the following: - ‘img_size’ int height of img to return - ‘default_img’ string img to return if email address has not found - ‘rating’ string rating parameter for avatar - ‘secure’ bool load from the SSL or Non-SSL location

Parameters:
  • string|null – Email address.
  • null|array – Options
  • array – Attributes for image tag (title, alt etc.)
Return type:

Gravatar

954.1.1.2. setOptions

setOptions()

Configure state

Parameters:array
Return type:Gravatar

954.1.1.3. getImgSize

getImgSize()

Get img size

Return type:int The img size

954.1.1.4. setImgSize

setImgSize()

Set img size in pixels

Parameters:int – Size of img must be between 1 and 512
Return type:Gravatar

954.1.1.5. getDefaultImg

getDefaultImg()

Get default img

Return type:string

954.1.1.6. setDefaultImg

setDefaultImg()

Set default img

Can be either an absolute URL to an image, or one of the DEFAULT_* constants

Parameters:string
Return type:Gravatar

954.1.1.7. setRating

setRating()

Set rating value

Must be one of the RATING_* constants

Parameters:string – Value for rating. Allowed values are: g, px, r,x
Return type:Gravatar
Throws :ExceptionDomainException

954.1.1.8. getRating

getRating()

Get rating value

Return type:string

954.1.1.9. setEmail

setEmail()

Set email address

Parameters:string
Return type:Gravatar

954.1.1.10. getEmail

getEmail()

Get email address

Return type:string

954.1.1.11. setSecure

setSecure()

Load from an SSL or No-SSL location?

Parameters:bool
Return type:Gravatar

954.1.1.12. getSecure

getSecure()

Get an SSL or a No-SSL location

Return type:bool

954.1.1.13. getAttribs

getAttribs()

Get attribs of image

Warning! If you set src attrib, you get it, but this value will be overwritten in protected method setSrcAttribForImg(). And finally your get other src value!

Return type:array

954.1.1.14. setAttribs

setAttribs()

Set attribs for image tag

Warning! You shouldn’t set src attrib for image tag. This attrib is overwritten in protected method setSrcAttribForImg(). This method(_setSrcAttribForImg) is called in public method getImgTag().

Parameters:array
Return type:Gravatar

954.1.1.15. getGravatarUrl

getGravatarUrl()

Get URL to gravatar’s service.

Return type:string URL

954.1.1.16. getAvatarUrl

getAvatarUrl()

Get avatar url (including size, rating and default image options)

Return type:string

954.1.1.17. setSrcAttribForImg

setSrcAttribForImg()

Set src attrib for image.

You shouldn’t set a own url value! It sets value, uses protected method getAvatarUrl.

If already exists, it will be overwritten.

Return type:void

954.1.1.18. getImgTag

getImgTag()

Return valid image tag

Return type:string

954.1.1.19. __toString

__toString()

Return valid image tag

Return type:string

954.1.2. Constants

954.1.2.1. GRAVATAR_URL

URL to gravatar service

954.1.2.2. GRAVATAR_URL_SECURE

Secure URL to gravatar service

954.1.2.3. RATING_G

Gravatar rating

954.1.2.4. RATING_PG

954.1.2.5. RATING_R

954.1.2.6. RATING_X

954.1.2.7. DEFAULT_404

Default gravatar image value constants

954.1.2.8. DEFAULT_MM

954.1.2.9. DEFAULT_IDENTICON

954.1.2.10. DEFAULT_MONSTERID

954.1.2.11. DEFAULT_WAVATAR