chore: complete update

This commit is contained in:
2025-07-17 16:24:20 +02:00
parent 899227b0a4
commit 64a7051137
1300 changed files with 85570 additions and 2756 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace App\Framework\View\Functions;
use App\Domain\Media\ImageSlotRepository;
use App\Domain\Media\ImageSourceSetGenerator;
use App\Framework\View\ComponentRenderer;
final readonly class ImageSlotFunction implements TemplateFunction
{
public string $functionName;
public function __construct(
private ImageSlotRepository $imageSlotRepository,
private ComponentRenderer $componentRenderer
){
$this->functionName = 'imageslot';
}
public function __invoke(string $slotName): string
{
$image = $this->imageSlotRepository->findBySlotName($slotName)->image;
$srcGen = new ImageSourceSetGenerator();
return $srcGen->generatePictureElement($image);
$data = [
'image' => $image->filename,
'alt' => $image->altText
];
return $this->componentRenderer->render('imageslot', $data);
}
}