You've already forked symfony-playground
first commit
This commit is contained in:
22
src/Controller/IndexController.php
Normal file
22
src/Controller/IndexController.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?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
|
||||
]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user