Zend Framework
3.0
|
Helper for retrieving avatars from gravatar.com. More...
Public Member Functions | |
__invoke ($email="", $options=[], $attribs=[]) | |
Returns an avatar from gravatar's service. | |
__toString () | |
Return valid image tag. | |
setOptions (array $options) | |
Configure state. | |
getImgTag () | |
Return valid image tag. | |
setAttribs (array $attribs) | |
Set attribs for image tag. | |
getAttribs () | |
Get attribs of image. | |
setDefaultImg ($defaultImg) | |
Set default img. | |
getDefaultImg () | |
Get default img. | |
setEmail ($email) | |
Set email address. | |
getEmail () | |
Get email address. | |
setImgSize ($imgSize) | |
Set img size in pixels. | |
getImgSize () | |
Get img size. | |
setRating ($rating) | |
Set rating value. | |
getRating () | |
Get rating value. | |
setSecure ($flag) | |
Load from an SSL or No-SSL location? | |
getSecure () | |
Get an SSL or a No-SSL location. | |
Public Member Functions inherited from AbstractHtmlElement | |
getClosingBracket () | |
Get the tag closing bracket. | |
Public Member Functions inherited from AbstractHelper | |
setView (Renderer $view) | |
Set the View object. | |
getView () | |
Get the view object. | |
Public Attributes | |
const | GRAVATAR_URL = 'http://www.gravatar.com/avatar' |
URL to gravatar service. | |
const | GRAVATAR_URL_SECURE = 'https://secure.gravatar.com/avatar' |
Secure URL to gravatar service. | |
const | RATING_G = 'g' |
Gravatar rating. | |
const | RATING_PG = 'pg' |
const | RATING_R = 'r' |
const | RATING_X = 'x' |
const | DEFAULT_404 = '404' |
Default gravatar image value constants. | |
const | DEFAULT_MM = 'mm' |
const | DEFAULT_IDENTICON = 'identicon' |
const | DEFAULT_MONSTERID = 'monsterid' |
const | DEFAULT_WAVATAR = 'wavatar' |
Public Attributes inherited from AbstractHtmlElement | |
const | EOL = PHP_EOL |
EOL character. | |
Protected Member Functions | |
getAvatarUrl () | |
Get avatar url (including size, rating and default image options) | |
getGravatarUrl () | |
Get URL to gravatar's service. | |
setSrcAttribForImg () | |
Set src attrib for image. | |
Protected Member Functions inherited from AbstractHtmlElement | |
isXhtml () | |
Is doctype XHTML? | |
htmlAttribs ($attribs) | |
Converts an associative array to a string of tag attributes. | |
normalizeId ($value) | |
Normalize an ID. | |
Protected Attributes | |
$attribs | |
$emailIsHashed | |
$options | |
Protected Attributes inherited from AbstractHtmlElement | |
$closingBracket = null | |
Protected Attributes inherited from AbstractHelper | |
$view = null | |
Helper for retrieving avatars from gravatar.com.
__invoke | ( | $email = "" , |
|
$options = [] , |
|||
$attribs = [] |
|||
) |
Returns an avatar from gravatar's service.
$options may include the following:
string | null | Email address. | |
null | array | $options | Options |
array | $attribs | Attributes for image tag (title, alt etc.) |
__toString | ( | ) |
Return valid image tag.
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!
|
protected |
Get avatar url (including size, rating and default image options)
getDefaultImg | ( | ) |
Get default img.
getEmail | ( | ) |
Get email address.
|
protected |
Get URL to gravatar's service.
getImgSize | ( | ) |
Get img size.
getImgTag | ( | ) |
Return valid image tag.
getRating | ( | ) |
Get rating value.
getSecure | ( | ) |
Get an SSL or a No-SSL location.
setAttribs | ( | array | $attribs | ) |
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().
array | $attribs |
setDefaultImg | ( | $defaultImg | ) |
Set default img.
Can be either an absolute URL to an image, or one of the DEFAULT_* constants
More information about default image. string $defaultImg Gravatar
setEmail | ( | ) |
setImgSize | ( | $imgSize | ) |
setOptions | ( | array | $options | ) |
setRating | ( | $rating | ) |
Set rating value.
Must be one of the RATING_* constants
setSecure | ( | $flag | ) |
|
protected |
Set src attrib for image.
You shouldn't set an own url value! It sets value, uses protected method getAvatarUrl.
If already exists, it will be overwritten.
|
protected |
|
protected |
|
protected |
|
protected |
const DEFAULT_404 = '404' |
Default gravatar image value constants.
const DEFAULT_IDENTICON = 'identicon' |
const DEFAULT_MM = 'mm' |
const DEFAULT_MONSTERID = 'monsterid' |
const DEFAULT_WAVATAR = 'wavatar' |
const GRAVATAR_URL = 'http://www.gravatar.com/avatar' |
URL to gravatar service.
const GRAVATAR_URL_SECURE = 'https://secure.gravatar.com/avatar' |
Secure URL to gravatar service.
const RATING_G = 'g' |
Gravatar rating.
const RATING_PG = 'pg' |
const RATING_R = 'r' |
const RATING_X = 'x' |