<?php declare(strict_types=1);

namespace Newland\Toubiz\Events\Neos\ViewHelpers\Widget;

use Neos\ContentRepository\Domain\Model\NodeInterface;
use Neos\FluidAdaptor\Core\Widget\AbstractWidgetViewHelper;
use Neos\Flow\Annotations as Flow;
use Newland\Toubiz\Events\Neos\ViewHelpers\Widget\Controller\TodayController;

class TodayViewHelper extends AbstractWidgetViewHelper
{

    /**
     * @var TodayController
     * @Flow\Inject()
     */
    protected $controller;

    public function render(NodeInterface $node): string
    {
        $this->controller->setNode($node);
        return $this->initiateSubRequest()->getContent();
    }
}
