Skip to content

Commit 422d31b

Browse files
committed
2 parents ff9a08d + 42047a6 commit 422d31b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/Resources/skeleton/crud/controller/ControllerWithTwig.tpl.php

+14-14
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,6 @@ public function index()
2929
return $this->render('<?= $route_name; ?>/index.html.twig', ['<?= $entity_var_plural; ?>' => $<?= $entity_var_plural; ?>]);
3030
}
3131

32-
/**
33-
* @Route("/{<?= $entity_identifier; ?>}", name="show")
34-
* @Method("GET")
35-
*/
36-
public function show(<?= $entity_class_name; ?> $<?= $entity_var_singular; ?>)
37-
{
38-
$deleteForm = $this->createDeleteForm($<?= $entity_var_singular; ?>);
39-
40-
return $this->render('<?= $route_name; ?>/show.html.twig', [
41-
'<?= $entity_var_singular; ?>' => $<?= $entity_var_singular; ?>,
42-
]);
43-
}
44-
4532
/**
4633
* @Route("/new", name="new")
4734
* @Method({"GET", "POST"})
@@ -66,6 +53,19 @@ public function new(Request $request)
6653
]);
6754
}
6855

56+
/**
57+
* @Route("/{<?= $entity_identifier; ?>}", name="show")
58+
* @Method("GET")
59+
*/
60+
public function show(<?= $entity_class_name; ?> $<?= $entity_var_singular; ?>)
61+
{
62+
$deleteForm = $this->createDeleteForm($<?= $entity_var_singular; ?>);
63+
64+
return $this->render('<?= $route_name; ?>/show.html.twig', [
65+
'<?= $entity_var_singular; ?>' => $<?= $entity_var_singular; ?>,
66+
]);
67+
}
68+
6969
/**
7070
* @Route("/{<?= $entity_identifier; ?>}/edit", name="edit")
7171
* @Method({"GET", "POST"})
@@ -95,7 +95,7 @@ public function edit(Request $request, <?= $entity_class_name; ?> $<?= $entity_v
9595
*/
9696
public function delete(Request $request, <?= $entity_class_name; ?> $<?= $entity_var_singular; ?>)
9797
{
98-
if (!$this->isCsrfTokenValid('delete'.$<?= $entity_var_singular; ?>->get<?= ucfirst($entity_identifier); ?>(), $request->request->get('token'))) {
98+
if (!$this->isCsrfTokenValid('delete'.$<?= $entity_var_singular; ?>->get<?= ucfirst($entity_identifier); ?>(), $request->request->get('_token'))) {
9999
return $this->redirectToRoute('<?= $route_name; ?>_index');
100100
}
101101

0 commit comments

Comments
 (0)