Download the PHP package ry167/twig-gravatar without Composer
On this page you can find all versions of the php package ry167/twig-gravatar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ry167/twig-gravatar
More information about ry167/twig-gravatar
Files in ry167/twig-gravatar
Package twig-gravatar
Short Description Gravatar filters for Twig templates
License MIT
Homepage https://github.com/ry167/twig-gravatar
Informations about the package twig-gravatar
Twig Gravatar
An extension for Twig that provides simple filters for Gravatar.
Installation
Use composer
to install this extension:
Usage
Usage in Symfony
You can also remove the arguments section and the default values will be used.
Filters
This Extension is designed so that you chain together the filters that you need on top of each other. You must however always start with the grAvatar filter.
grAvatar
Create a Gravatar URL, This returns just the URL for the persons avatar image without the <img>
tag
grHttps
Change a Gravatar URL to its secure counterpart.
grSize
Change the Size of the Gravatar Image to the specified size in pixels.
Gravatar does not serve images greater than 2048px
, and they are all squares.
grDefault
Specify a default image for if the User does not have one defined
You can also use any of Gravatar's built in default images, you can see them here. Just use the code assigned to them such as mm
instead of your Image URL.
grRating
Specify a maximum rating that the image can be.
Valid values are g
, pg
, r
and x
.
Prefix
You can change the filter prefix from gr
to something else by changing its value in constructor.