<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use App\Repository\ShopProduktRepository;
use App\Repository\ShopKategorieRepository;
class SiteController extends AbstractController
{
#[Route('/', name: 'home')]
public function index(): Response
{
return $this->render('index.html.twig');
}
#[Route('/about', name: 'about')]
public function about(): Response
{
return $this->render('about.html.twig');
}
#[Route('/hilfe', name: 'hilfe')]
public function help(): Response
{
return $this->render('hilfe.html.twig');
}
#[Route('/leistung', name: 'leistung')]
public function leistung(): Response
{
return $this->render('leistung.html.twig');
}
#[Route('/preise', name: 'preise')]
public function preise(ShopProduktRepository $shopProduktRepository, ShopKategorieRepository $shopKategorieRepository): Response
{
// Die Kategorien "VPN" (id = 1) und "Discord Bots" (id = 2) abrufen
// Ersetze 1 und 2 durch die tatsächlichen IDs in deiner Datenbank
$vpnKategorie = $shopKategorieRepository->find(1);
$discordBotKategorie = $shopKategorieRepository->find(2);
// Produkte anhand der Kategorien abrufen
$vpnProdukte = $shopProduktRepository->findBy(['kategorie' => $vpnKategorie]);
$discordBotProdukte = $shopProduktRepository->findBy(['kategorie' => $discordBotKategorie]);
return $this->render('preise.html.twig', [
'vpnProdukte' => $vpnProdukte,
'discordBotProdukte' => $discordBotProdukte,
]);
}
#[Route('/partner-werden', name: 'partner_become', methods: ['GET'])]
public function partnerBecome(): Response
{
return $this->render('partner_werden.html.twig');
}
#[Route('/datenschutz', name: 'datenschutz', methods: ['GET'])]
public function datenschutz(): Response
{
return $this->render('datenschutz.html.twig');
}
#[Route('/impressum', name: 'impressum', methods: ['GET'])]
public function impressum(): Response
{
return $this->render('impressum.html.twig');
}
#[Route('/agb', name: 'agb', methods: ['GET'])]
public function agb(): Response
{
return $this->render('agb.html.twig');
}
#[Route('/karriere', name: 'karriere', methods: ['GET'])]
public function karriere(): Response
{
return $this->render('karriere.html.twig');
}
}