Zend\View\Helper\Gravatar
Helper for retrieving avatars from gravatar.com
Synopsis
class Gravatar
extends AbstractHtmlElement
{
- // constants
- const GRAVATAR_URL = 'http://www.gravatar.com/avatar';
- const GRAVATAR_URL_SECURE = 'https://secure.gravatar.com/avatar';
- const RATING_G = 'g';
- const RATING_PG = 'pg';
- const RATING_R = 'r';
- const RATING_X = 'x';
- const DEFAULT_404 = '404';
- const DEFAULT_MM = 'mm';
- const DEFAULT_IDENTICON = 'identicon';
- const DEFAULT_MONSTERID = 'monsterid';
- const DEFAULT_WAVATAR = 'wavatar';
- // Inherited constants from AbstractHtmlElement
- const EOL = ;
- // members
- protected array $attribs;
- protected string $email;
- protected bool $emailIsHashed;
- protected array $options;
- // Inherited members from AbstractHtmlElement
- protected string $closingBracket;
- // Inherited members from AbstractHelper
- protected RendererInterface $view;
- // methods
- public Gravatar __invoke()
- public string __toString()
- public Gravatar setOptions()
- protected string getAvatarUrl()
- protected string getGravatarUrl()
- public string getImgTag()
- public Gravatar setAttribs()
- public array getAttribs()
- public Gravatar setDefaultImg()
- public string getDefaultImg()
- public Gravatar setEmail()
- public string getEmail()
- public Gravatar setImgSize()
- public int getImgSize()
- public Gravatar setRating()
- public string getRating()
- public Gravatar setSecure()
- public bool getSecure()
- protected void setSrcAttribForImg()
- // Inherited methods from AbstractHtmlElement
- public string getClosingBracket()
- protected bool isXhtml()
- protected string htmlAttribs()
- protected string normalizeId()
- // Inherited methods from AbstractHelper
- public AbstractHelper setView()
- public null|Renderer getView()
Hierarchy
Constants
Name | Value |
---|---|
GRAVATAR_URL | 'http://www.gravatar.com/avatar' |
GRAVATAR_URL_SECURE | 'https://secure.gravatar.com/avatar' |
RATING_G | 'g' |
RATING_PG | 'pg' |
RATING_R | 'r' |
RATING_X | 'x' |
DEFAULT_404 | '404' |
DEFAULT_MM | 'mm' |
DEFAULT_IDENTICON | 'identicon' |
DEFAULT_MONSTERID | 'monsterid' |
DEFAULT_WAVATAR | 'wavatar' |
EOL |
Members
protected
- $attribs
—
array
Attributes for HTML image tag - $closingBracket
—
string
The tag closing bracket - $email
—
string
Email Address - $emailIsHashed
—
Zend\View\Helper\bool
True or false if the email address passed is already an MD5 hash - $options
—
array
Options - $view
—
Zend\View\Renderer\RendererInterface
View object instance
Methods
protected
- getAvatarUrl() — Get avatar url (including size, rating and default image options)
- getGravatarUrl() — Get URL to gravatar's service.
- setSrcAttribForImg() — Set src attrib for image.
public
- __invoke() — Returns an avatar from gravatar's service.
- __toString() — Return valid image tag
- getAttribs() — Get attribs of image
- getDefaultImg() — Get default img
- getEmail() — Get email address
- getImgSize() — Get img size
- getImgTag() — Return valid image tag
- getRating() — Get rating value
- getSecure() — Get an SSL or a No-SSL location
- setAttribs() — Set attribs for image tag
- setDefaultImg() — Set default img
- setEmail() — Set email address
- setImgSize() — Set img size in pixels
- setOptions() — Configure state
- setRating() — Set rating value
- setSecure() — Load from an SSL or No-SSL location?
Inherited from Zend\View\Helper\AbstractHtmlElement
protected
- htmlAttribs() — Converts an associative array to a string of tag attributes.
- isXhtml() — Is doctype XHTML?
- normalizeId() — Normalize an ID
public
- getClosingBracket() — Get the tag closing bracket