Create snippets skeleton

This commit is contained in:
Tim
2023-04-03 23:44:13 +02:00
parent bf83e5aabd
commit 921dcf1e97
15 changed files with 310 additions and 30 deletions

View File

@ -0,0 +1,29 @@
<?php
namespace App\Controller;
use App\Entity\Snip;
use App\Repository\SnipRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
#[Route('/snip', name: 'snip')]
class SnipController extends AbstractController
{
#[Route('/', name: '_index')]
public function index(SnipRepository $repository): Response
{
return $this->render('snip/index.html.twig', [
'snips' => $repository->findAll(),
]);
}
#[Route('/singe/{snip}', name: '_single')]
public function single(Snip $snip): Response
{
return $this->render('snip/single.html.twig', [
'snip' => $snip,
]);
}
}