<?php
namespace App\Controller;
use App\Repository\ContentBlockRepository;
use App\Repository\EmployeeRepository;
use App\Repository\PartnerRepository;
use App\Repository\SkillRepository;
use App\Repository\TestimonialRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class DemoController extends AbstractController
{
public function __construct(
private EmployeeRepository $employeeRepository,
private ContentBlockRepository $contentBlockRepository,
private TestimonialRepository $testimonialRepository,
private SkillRepository $skillRepository,
private PartnerRepository $partnerRepository
) {
}
#[Route('/', name: 'demo')]
public function index(): Response {
// Beispiel-Daten, die wir an Twig übergeben
$data = [
'title' => 'Demo-Seite',
'items' => ['Apfel', 'Banane', 'Kirsche']
];
return $this->render('index.html.twig', [
'data' => $data,
'employees' => $this->employeeRepository->findAllOrdered(),
'testimonials' => $this->testimonialRepository->findAllOrdered(),
'skills' => $this->skillRepository->findAllOrdered(),
'partners' => $this->partnerRepository->findAllOrdered(),
'team_intro' => $this->contentBlockRepository->findOneBySlug('team_intro'),
'about_us' => $this->contentBlockRepository->findOneBySlug('about_us'),
'feature_1' => $this->contentBlockRepository->findOneBySlug('feature_1'),
'feature_2' => $this->contentBlockRepository->findOneBySlug('feature_2'),
'feature_3' => $this->contentBlockRepository->findOneBySlug('feature_3'),
'employer_cta' => $this->contentBlockRepository->findOneBySlug('employer_cta'),
'hero_text' => $this->contentBlockRepository->findOneBySlug('hero_text'),
]);
}
}