mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-12-23 20:26:10 +01:00
tea/Classes/Controller/TeaController.php

36 lines
843 B
PHP
Raw Normal View History

<?php
declare(strict_types=1);
namespace TTN\Tea\Controller;
use Psr\Http\Message\ResponseInterface;
use TTN\Tea\Domain\Model\Product\Tea;
use TTN\Tea\Domain\Repository\Product\TeaRepository;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
/**
* Controller for the main "Tea" FE plugin.
*/
class TeaController extends ActionController
{
private TeaRepository $teaRepository;
public function __construct(TeaRepository $teaRepository)
{
$this->teaRepository = $teaRepository;
}
public function indexAction(): ResponseInterface
{
$this->view->assign('teas', $this->teaRepository->findAll());
return $this->htmlResponse();
}
2018-05-28 17:05:39 +02:00
public function showAction(Tea $tea): ResponseInterface
2018-05-28 17:05:39 +02:00
{
$this->view->assign('tea', $tea);
return $this->htmlResponse();
2018-05-28 17:05:39 +02:00
}
}