Domains: Fetch list of domains from database
This commit is contained in:
parent
b890432e5b
commit
d5789fdedf
7 changed files with 98 additions and 11 deletions
|
|
@ -3,15 +3,28 @@ declare(strict_types=1);
|
|||
|
||||
namespace MailAccountAdmin\Frontend\Domains;
|
||||
|
||||
use MailAccountAdmin\Common\UserHelper;
|
||||
use MailAccountAdmin\Frontend\BaseController;
|
||||
use MailAccountAdmin\Repositories\DomainRepository;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Slim\Views\Twig;
|
||||
|
||||
class DomainController extends BaseController
|
||||
{
|
||||
/** @var DomainRepository */
|
||||
private $domainRepository;
|
||||
|
||||
public function __construct(Twig $view, UserHelper $userHelper, DomainRepository $domainRepository)
|
||||
{
|
||||
parent::__construct($view, $userHelper);
|
||||
$this->domainRepository = $domainRepository;
|
||||
}
|
||||
|
||||
public function showDomains(Request $request, Response $response): Response
|
||||
{
|
||||
$renderData = [
|
||||
'domainList' => $this->domainRepository->fetchDomainList(),
|
||||
];
|
||||
|
||||
return $this->view->render($response, 'domains.html.twig', $renderData);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue