PHP code example of thomaswelton / gravatarlib

1. Go to this page and download the library: Download thomaswelton/gravatarlib library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

thomaswelton / gravatarlib example snippets

 php
	
	ar = new \emberlabs\GravatarLib\Gravatar();
	// example: setting default image and maximum size
	$gravatar->setDefaultImage('mm')
		->setAvatarSize(150);
	// example: setting maximum allowed avatar rating
	$gravatar->setMaxRating('pg');
	$avatar = $gravatar->buildGravatarURL('[email protected]');
 php
	$gravatar->setDefaultImage('wavatar');
 php
	$gravatar->setAvatarSize(184);
 php
	$gravatar->setMaxRating('r');
 php
	
	// __ . '/ravatar library object
    $gravatar = new \emberlabs\GravatarLib\Gravatar();

	// ... do whatever you want with your settings here

	// here, we will assume $twig is an already-created instance of Twig_Environment
	$twig->addGlobal('gravatar', $gravatar);