mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2025-02-14 18:43:49 +01:00
32 lines
760 B
PHP
32 lines
760 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace TTN\Tea\Controller;
|
|
|
|
use Psr\Http\Message\ResponseInterface;
|
|
use TTN\Tea\Domain\Model\Tea;
|
|
use TTN\Tea\Domain\Repository\TeaRepository;
|
|
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
|
|
|
/**
|
|
* Controller for the main "Tea" FE plugin.
|
|
*/
|
|
class TeaController extends ActionController
|
|
{
|
|
public function __construct(
|
|
private readonly TeaRepository $teaRepository,
|
|
) {}
|
|
|
|
public function indexAction(): ResponseInterface
|
|
{
|
|
$this->view->assign('teas', $this->teaRepository->findAll());
|
|
return $this->htmlResponse();
|
|
}
|
|
|
|
public function showAction(Tea $tea): ResponseInterface
|
|
{
|
|
$this->view->assign('tea', $tea);
|
|
return $this->htmlResponse();
|
|
}
|
|
}
|