Initial Commit
This commit is contained in:
1 parent
4f495177e4
commit
b6d2142214
166 files changed
+13952
-178
No files matched your search
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Evomedien\Vitec\Controller;
|
||||
|
||||
use Evomedien\Vitec\Domain\Repository\UsecaseRepository;
|
||||
use Evomedien\Vitec\Domain\Model\Usecase;
|
||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* 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) 2025
|
||||
*/
|
||||
|
||||
/**
|
||||
* UsecaseController
|
||||
*/
|
||||
class UsecaseController extends ActionController
|
||||
{
|
||||
/**
|
||||
* usecaseRepository
|
||||
*
|
||||
* @var UsecaseRepository
|
||||
*/
|
||||
protected $usecaseRepository;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param UsecaseRepository $usecaseRepository
|
||||
*/
|
||||
public function __construct(UsecaseRepository $usecaseRepository)
|
||||
{
|
||||
$this->usecaseRepository = $usecaseRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* action show
|
||||
*
|
||||
* @param Usecase $usecase
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function showAction(): ResponseInterface
|
||||
{
|
||||
$selectedUsecaseId = (int)$this->settings['usecase']; // Die ID aus dem Flexform
|
||||
$usecase = null;
|
||||
if ($selectedUsecaseId) {
|
||||
$usecase = $this->usecaseRepository->findByUid($selectedUsecaseId);
|
||||
}
|
||||
|
||||
$this->view->assign('usecase', $usecase);
|
||||
|
||||
return $this->htmlResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* action list
|
||||
*
|
||||
* @param Usecase $usecase
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function listAction(): ResponseInterface
|
||||
{
|
||||
$usecases = $this->usecaseRepository->findAllWithCategories();
|
||||
$this->view->assign('usecases', $usecases);
|
||||
|
||||
return $this->htmlResponse();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user