mirror of
https://github.com/doctrine/doctrine-website.git
synced 2026-03-23 22:32:11 +01:00
Maintaining a standalone static website generator project that is not reused outside our website adds maintenance overhead. For instance, support for using `phpdocumentor/guides` was implemented in the website repo rather than the standalone generator package, which was still using the `doctrine/rst-parser` package that we want to abandon.
33 lines
802 B
PHP
33 lines
802 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Doctrine\Website\Controllers;
|
|
|
|
use Doctrine\Website\Model\Partner;
|
|
use Doctrine\Website\Repositories\PartnerRepository;
|
|
use Doctrine\Website\StaticGenerator\Controller\Response;
|
|
|
|
final readonly class PartnersController
|
|
{
|
|
/** @param PartnerRepository<Partner> $partnerRepository */
|
|
public function __construct(
|
|
private PartnerRepository $partnerRepository,
|
|
) {
|
|
}
|
|
|
|
public function index(): Response
|
|
{
|
|
$partners = $this->partnerRepository->findAll();
|
|
|
|
return new Response(['partners' => $partners]);
|
|
}
|
|
|
|
public function view(string $slug): Response
|
|
{
|
|
$partner = $this->partnerRepository->findOneBySlug($slug);
|
|
|
|
return new Response(['partner' => $partner], '/partner.html.twig');
|
|
}
|
|
}
|