Create a Docker image and deploy it
This commit is contained in:
20
src/Controller/PostController.php
Normal file
20
src/Controller/PostController.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Repository\PostRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
class PostController extends AbstractController
|
||||
{
|
||||
#[Route('/', name: 'app_posts')]
|
||||
public function index(PostRepository $repository): Response
|
||||
{
|
||||
$posts = $repository->findAll();
|
||||
return $this->render('post/index.html.twig', [
|
||||
'posts' => $posts,
|
||||
]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user