symfony-playground/src/Controller/IndexController.php

23 lines
605 B
PHP
Raw Normal View History

2022-05-21 10:32:17 +00:00
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use App\Repository\Entity1Repository;
class IndexController extends AbstractController
{
#[Route('/', name: 'app_index')]
public function index(Entity1Repository $repo): Response
{
$entity8 = $repo->findOneByName('entity 8');
return $this->render('index/index.html.twig', [
'controller_name' => 'IndexController',
'entity8' => $entity8
]);
}
}