Initial Commit
This commit is contained in:
60
packages/vitec/Classes/Controller/SolutionController.php
Normal file
60
packages/vitec/Classes/Controller/SolutionController.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Evomedien\Vitec\Controller;
|
||||
|
||||
use Evomedien\Vitec\Domain\Repository\SolutionRepository;
|
||||
use Evomedien\Vitec\Domain\Model\Solution;
|
||||
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
|
||||
*/
|
||||
|
||||
/**
|
||||
* SolutionController
|
||||
*/
|
||||
class SolutionController extends ActionController
|
||||
{
|
||||
/**
|
||||
* solutionRepository
|
||||
*
|
||||
* @var SolutionRepository
|
||||
*/
|
||||
protected $solutionRepository;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param SolutionRepository $solutionRepository
|
||||
*/
|
||||
public function __construct(SolutionRepository $solutionRepository)
|
||||
{
|
||||
$this->solutionRepository = $solutionRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* action show
|
||||
*
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function showAction(): ResponseInterface
|
||||
{
|
||||
$selectedSolutionId = (int)$this->settings['solution'];
|
||||
$solution = null;
|
||||
if ($selectedSolutionId) {
|
||||
$solution = $this->solutionRepository->findByUid($selectedSolutionId);
|
||||
}
|
||||
|
||||
$this->view->assign('solution', $solution);
|
||||
|
||||
return $this->htmlResponse();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user