<?php
namespace Newland\Toubiz\Events\Neos\ViewHelpers\Widget;

/*
 * This file is part of the "toubiz-events-neos" package.
 *
 * For the full copyright and license information, please read the
 * LICENSE.txt file that was distributed with this source code.
 */

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

class HighlightsViewHelper extends AbstractWidgetViewHelper
{
    /**
     * @Flow\Inject()
     * @var HighlightsController
     */
    protected $controller;

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