<?php

namespace App\Twig;

use Psr\Container\ContainerInterface;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;

class AppExtension extends AbstractExtension
{
//    public function __construct(private ContainerInterface $container)
//    {
//    }

    public function getFunctions(): array
    {
        return [
            new TwigFunction('avatar_asset', [$this, 'getAvatarPath'])
        ];
    }

    public function getAvatarPath(string $path): string
    {
        return '/uploads/avatars/' . $path;
    }

}