mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-12-27 20:06:10 +01:00
tea/Classes/Controller/TeaController.php
2019-12-07 12:13:32 +01:00

37 lines
804 B
PHP

<?php
declare(strict_types=1);
namespace TTN\Tea\Controller;
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.
*
* @author Oliver Klee <typo3-coding@oliverklee.de
*/
class TeaController extends ActionController
{
/**
* @var TeaRepository
*/
private $teaRepository = null;
public function injectTeaRepository(TeaRepository $teaRepository): void
{
$this->teaRepository = $teaRepository;
}
public function indexAction(): void
{
$this->view->assign('teas', $this->teaRepository->findAll());
}
public function showAction(Tea $tea): void
{
$this->view->assign('tea', $tea);
}
}