ZF2 helper extends Zend\View\Helper\Gravatar
- Get the gravatar from an email address
- Get Gravatar from the current logged user
- Available edition link for the current logged user
- Indicate if the current logged user or the email address has a Gravatar
- Multilinguage EN / FR / ES / IT / RO
{
"name": "zendframework/skeleton-application",
"description": "Skeleton Application for ZF2",
"license": "BSD-3-Clause",
"keywords": [
"framework",
"zf2"
],
"minimum-stability": "dev",
"homepage": "http://framework.zend.com/",
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "dev-master",
"remithomas/rt-gravatar": "dev-master"
}
}
application.config.php
<?php
return array(
'modules' => array(
'Application',
'RtGravatar',
)
);
?>
If you need to use this plugin only in one module. Just copy this code and add it into your own module config (module.config.php)
<?php
return array(
...
'view_helpers' => array(
'invokables' => array(
'RtGravatar' => 'RtGravatar\View\Helper\RtGravatar',
'RtHasGravatar' => 'RtGravatar\View\Helper\RtHasGravatar'
)
),
...
If you need to use this plugin in all your application. Just copy the file rt-gravatar.global.php.dist (/vendor/remithomas/rt-gravatar/config/) and paste it into the folder /config/autoload/
<?php
$options = array("img_size"=>150);
$attribs = array();
echo $this->RtGravatar("me@example.com",$options,$attribs,true);
?>
<?php
var_dump ($this->RtHasGravatar("me@example.com");
?>
<?php
var_dump ($this->RtHasGravatar("me");
// or
var_dump ($this->RtHasGravatar();
?>
<?php
$options = array("img_size"=>150);
$attribs = array();
echo $this->RtGravatar("me",$options,$attribs,true);
?>