mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-01-14 21:31:23 +00:00
36 lines
987 B
PHP
36 lines
987 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Chill\MainBundle\Templating\Entity;
|
|
|
|
use Twig\Extension\AbstractExtension;
|
|
use Twig\TwigFilter;
|
|
|
|
/**
|
|
* Class ChillEntityRenderExtension.
|
|
*/
|
|
class ChillEntityRenderExtension
|
|
{
|
|
public function __construct(private readonly ChillEntityRenderManagerInterface $renderManager) {}
|
|
|
|
#[\Twig\Attribute\AsTwigFilter('chill_entity_render_box', isSafe: ['html'])]
|
|
public function renderBox(?object $entity, array $options = []): string
|
|
{
|
|
return $this->renderManager->renderBox($entity, $options);
|
|
}
|
|
|
|
#[\Twig\Attribute\AsTwigFilter('chill_entity_render_string', isSafe: ['html'])]
|
|
public function renderString(?object $entity, array $options = []): string
|
|
{
|
|
return $this->renderManager->renderString($entity, $options);
|
|
}
|
|
}
|