Source of file Gravatar.php
Size: 0,996 Bytes - Last Modified: 2017-11-08T13:54:24+00:00
/home/travis/build/bluzphp/framework/src/View/Helper/Gravatar.php
123456789101112131415161718192021222324252627282930313233 | <?php /** * Bluz Framework Component * * @copyright Bluz PHP Team * @link https://github.com/bluzphp/framework */ declare(strict_types=1); namespace Bluz\View\Helper; use Bluz\Application\Application; use Bluz\Proxy\Layout; use Bluz\View\View; /** * Get either a Gravatar URL or complete image tag for a specified email address. * * @param string $email The email address * @param integer $size Size in pixels, defaults to 80px [ 1 - 2048 ] * @param string $default Default set of images to use [ 404 | mm | identicon | monsterid | wavatar ] * @param string $rate Maximum rating (inclusive) [ g | pg | r | x ] * * @return String containing either just a URL or a complete image tag * @source https://gravatar.com/site/implement/images/php/ */ return function ($email, $size = 80, $default = 'mm', $rate = 'g') { $email = md5(strtolower(trim($email ?? ''))); return "https://www.gravatar.com/avatar/$email?s=$size&d=$default&r=$rate"; }; |