Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 815 Bytes

README.md

File metadata and controls

28 lines (18 loc) · 815 Bytes

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