Skip to content

Commit

Permalink
Update Controller.tpl.php
Browse files Browse the repository at this point in the history
  • Loading branch information
seb-jean authored Oct 23, 2024
1 parent ce60831 commit 864f6d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions templates/crud/controller/Controller.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#[Route('<?= $route_path ?>')]
<?= $class_data->getClassDeclaration() ?>
{
<?= $generator->generateRouteForControllerMethod('', sprintf('%s_index', $route_name), ['GET']) ?>
<?= $generator->generateRouteForControllerMethod('', sprintf('%s_index', $route_name), 'GET') ?>
<?php if (isset($repository_full_class_name)): ?>
public function index(<?= $repository_class_name ?> $<?= $repository_var ?>): Response
{
Expand Down Expand Up @@ -48,7 +48,7 @@ public function new(Request $request, EntityManagerInterface $entityManager): Re
]);
}

<?= $generator->generateRouteForControllerMethod(sprintf('/{%s}', $entity_identifier), sprintf('%s_show', $route_name), ['GET']) ?>
<?= $generator->generateRouteForControllerMethod(sprintf('/{%s}', $entity_identifier), sprintf('%s_show', $route_name), 'GET') ?>
public function show(<?= $entity_class_name ?> $<?= $entity_var_singular ?>): Response
{
return $this->render('<?= $templates_path ?>/show.html.twig', [
Expand All @@ -74,7 +74,7 @@ public function edit(Request $request, <?= $entity_class_name ?> $<?= $entity_va
]);
}

<?= $generator->generateRouteForControllerMethod(sprintf('/{%s}', $entity_identifier), sprintf('%s_delete', $route_name), ['POST']) ?>
<?= $generator->generateRouteForControllerMethod(sprintf('/{%s}', $entity_identifier), sprintf('%s_delete', $route_name), 'POST') ?>
public function delete(Request $request, <?= $entity_class_name ?> $<?= $entity_var_singular ?>, EntityManagerInterface $entityManager): Response
{
if ($this->isCsrfTokenValid('delete'.$<?= $entity_var_singular ?>->get<?= ucfirst($entity_identifier) ?>(), $request->getPayload()->getString('_token'))) {
Expand Down

0 comments on commit 864f6d0

Please sign in to comment.