Files
VITEC-website/packages/vitec/Classes/Controller/EventController.php
2026-07-09 10:10:05 +02:00

40 lines
1.0 KiB
PHP
Executable File

<?php
declare(strict_types=1);
namespace Evomedien\Vitec\Controller;
use Evomedien\Vitec\Domain\Repository\EventRepository;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
/**
* This file is part of the "VITEC" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* (c) 2026
*/
/**
* EventController — Extbase registration target for the Eventlist plugin.
* In headless mode the JSON output is produced by EventlistJsonRenderer,
* not by this controller.
*/
class EventController extends ActionController
{
protected EventRepository $eventRepository;
public function __construct(EventRepository $eventRepository)
{
$this->eventRepository = $eventRepository;
}
public function listAction(): ResponseInterface
{
$this->view->assign('events', $this->eventRepository->findUpcoming());
return $this->htmlResponse();
}
}