<?php
// src/view/CalendarBuilder.php

declare(strict_types=1);

use App\Entity\Node;

class CalendarBuilder extends AbstractBuilder
{
    public function __construct(Node $node)
    {
        parent::__construct($node);
        $viewFile = self::VIEWS_PATH . $node->getName() . '.php';

        $calendar_js_file = IS_ADMIN ? 'calendar_admin' : 'calendar';
        
        if(file_exists($viewFile))
        {
            if(!empty($node->getNodeData()->getData()))
            {
                extract($node->getNodeData()->getData());
            }

            ob_start();
            require $viewFile;
            $this->html = ob_get_clean(); // pas de concaténation ici, on écrase
        }
    }
}