Skip to content

This Twig extension generates user avatar using name initials letter inside Twig templates.

License

Notifications You must be signed in to change notification settings

olivsinz/twig-avatar-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Avatar Extension

This Twig extension generates user avatar using name initials letter inside Twig templates. Based on yohang88/letter-avatar

  • avatar

Install

Via Composer

$ composer require olivers/twig-avatar-extension

Showing avatar based on user complete name

Use the avatar function to generate user avatar.

{% set userCompleteName = 'Peter Jackson' %}
<img src="{{ avatar(userCompleteName, '', 64) }}" />

This example would output avatar with two initials letter like PJ, as Peter Jackson is the providen user name.

alt Avatar examples

About

This Twig extension generates user avatar using name initials letter inside Twig templates.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages