symfony-playground/src/Controller/IndexController.php

26 lines
714 B
PHP
Raw Normal View History

2022-05-21 10:32:17 +00:00
<?php
namespace App\Controller;
2022-05-22 16:01:54 +00:00
use Doctrine\ORM\EntityManager;
2022-05-21 10:32:17 +00:00
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
{
2022-05-22 16:01:54 +00:00
$sm = $repo->getSchemaManager();
2022-05-21 10:32:17 +00:00
$entity8 = $repo->findOneByName('entity 8');
return $this->render('index/index.html.twig', [
'controller_name' => 'IndexController',
2022-05-22 16:01:54 +00:00
'entity8' => $entity8,
'schemaManager' => $sm
2022-05-21 10:32:17 +00:00
]);
}
}