PHP code example of ry167 / twig-gravatar
1. Go to this page and download the library: Download ry167/twig-gravatar 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/ */
ry167 / twig-gravatar example snippets
//Define your Twig Environment and Twig Loader
$twig->addExtension(new \TwigGravatar());
//or create a customized Twig Gravatar instance
new \TwigGravatar($default = null, $size = null, $filterPrefix = 'gr', $rating = null, $useHttps = true);
//Define your Twig Environment and Twig Loader
$TwigGravatar = new \TwigGravatar(null, null, 'foo');
$twig->addExtension($TwigGravatar);
//Filters are now 'fooAvatar' etc