olivers/twig-avatar-extension

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

v1.0.0 2018-09-07 13:17 UTC

This package is auto-updated.

Last update: 2025-03-08 04:10:55 UTC


README

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