1
- <?= "<?php \n" ?>
1
+ <?= "<?php \n" ; ?>
2
2
3
3
namespace App\Controller;
4
4
5
- use App\Entity\<?= $ entity_class_name ?> ;
6
- use App\Form\<?= $ form_class_name ?> ;
5
+ use App\Entity\<?= $ entity_class_name; ?> ;
6
+ use App\Form\<?= $ form_class_name; ?> ;
7
7
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
8
8
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
9
9
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
10
10
use Symfony\Component\HttpFoundation\Request;
11
11
use Symfony\Component\HttpFoundation\Response;
12
12
13
13
/**
14
- * @Route("<?= $ route_path ?> ", name="<?= $ route_name ?> _")
14
+ * @Route("<?= $ route_path; ?> ", name="<?= $ route_name; ?> _")
15
15
*/
16
16
class <?= $ controller_class_name ?> extends Controller
17
17
{
@@ -22,27 +22,27 @@ class <?= $controller_class_name ?> extends Controller
22
22
*/
23
23
public function index()
24
24
{
25
- $<?= $ entity_var_plural ?> = $this->getDoctrine()
26
- ->getRepository(<?= $ entity_class_name ?> ::class)
25
+ $<?= $ entity_var_plural; ?> = $this->getDoctrine()
26
+ ->getRepository(<?= $ entity_class_name; ?> ::class)
27
27
->findAll();
28
28
29
- return $this->render('<?= $ route_name ?> /index.html.twig', ['<?= $ entity_var_plural ?> ' => $<?= $ entity_var_plural ?> ]);
29
+ return $this->render('<?= $ route_name; ?> /index.html.twig', ['<?= $ entity_var_plural; ?> ' => $<?= $ entity_var_plural; ?> ]);
30
30
}
31
31
32
32
/**
33
- * @Route("/{<?= $ entity_identifier ?> }", name="show")
33
+ * @Route("/{<?= $ entity_identifier; ?> }", name="show")
34
34
* @Method("GET")
35
35
*
36
- * @param <?= $ entity_class_name ?> $<?= $ entity_var_singular ?> The <?= $ entity_class_name ?> entity
36
+ * @param <?= $ entity_class_name; ?> $<?= $ entity_var_singular; ?> The <?= $ entity_class_name; ?> entity
37
37
*
38
38
* @return Response
39
39
*/
40
- public function show(<?= $ entity_class_name ?> $<?= $ entity_var_singular ?> )
40
+ public function show(<?= $ entity_class_name; ?> $<?= $ entity_var_singular; ?> )
41
41
{
42
- $deleteForm = $this->createDeleteForm($<?= $ entity_var_singular ?> );
42
+ $deleteForm = $this->createDeleteForm($<?= $ entity_var_singular; ?> );
43
43
44
- return $this->render('<?= $ route_name ?> /show.html.twig', [
45
- '<?= $ entity_var_singular ?> ' => $<?= $ entity_var_singular ?> ,
44
+ return $this->render('<?= $ route_name; ?> /show.html.twig', [
45
+ '<?= $ entity_var_singular; ?> ' => $<?= $ entity_var_singular; ?> ,
46
46
'delete_form' => $deleteForm->createView(),
47
47
]);
48
48
}
@@ -57,87 +57,87 @@ public function show(<?= $entity_class_name ?> $<?= $entity_var_singular ?>)
57
57
*/
58
58
public function new(Request $request)
59
59
{
60
- $<?= $ entity_var_singular ?> = new <?= $ entity_class_name ?> ();
61
- $form = $this->createForm(<?= $ form_class_name?> ::class, $<?= $ entity_var_singular ?> );
60
+ $<?= $ entity_var_singular; ?> = new <?= $ entity_class_name; ?> ();
61
+ $form = $this->createForm(<?= $ form_class_name; ?> ::class, $<?= $ entity_var_singular; ?> );
62
62
$form->handleRequest($request);
63
63
64
64
if ($form->isSubmitted() && $form->isValid()) {
65
65
$em = $this->getDoctrine()->getManager();
66
- $em->persist($<?= $ entity_var_singular ?> );
66
+ $em->persist($<?= $ entity_var_singular; ?> );
67
67
$em->flush();
68
68
69
- return $this->redirectToRoute('<?= $ route_name ?> _edit', ['<?= $ entity_identifier ?> ' => $<?= $ entity_var_singular ?> ->get<?= ucfirst ($ entity_identifier ) ?> ()]);
69
+ return $this->redirectToRoute('<?= $ route_name; ?> _edit', ['<?= $ entity_identifier; ?> ' => $<?= $ entity_var_singular; ?> ->get<?= ucfirst ($ entity_identifier ); ?> ()]);
70
70
}
71
71
72
- return $this->render('<?= $ route_name ?> /new.html.twig', [
73
- '<?= $ entity_var_singular ?> ' => $<?= $ entity_var_singular ?> ,
72
+ return $this->render('<?= $ route_name; ?> /new.html.twig', [
73
+ '<?= $ entity_var_singular; ?> ' => $<?= $ entity_var_singular; ?> ,
74
74
'form' => $form->createView(),
75
75
]);
76
76
}
77
77
78
78
/**
79
- * @Route("/{<?= $ entity_identifier ?> }/edit", name="edit")
79
+ * @Route("/{<?= $ entity_identifier; ?> }/edit", name="edit")
80
80
* @Method({"GET", "POST"})
81
81
*
82
82
* @param Request $request
83
- * @param <?= $ entity_class_name ?> $<?= $ entity_var_singular ?> The <?= $ entity_class_name ?> entity
83
+ * @param <?= $ entity_class_name; ?> $<?= $ entity_var_singular; ?> The <?= $ entity_class_name; ?> entity
84
84
*
85
85
* @return Response
86
86
*/
87
- public function edit(Request $request, <?= $ entity_class_name ?> $<?= $ entity_var_singular ?> )
87
+ public function edit(Request $request, <?= $ entity_class_name; ?> $<?= $ entity_var_singular; ?> )
88
88
{
89
- $form = $this->createForm(<?= $ form_class_name?> ::class, $<?= $ entity_var_singular ?> );
89
+ $form = $this->createForm(<?= $ form_class_name; ?> ::class, $<?= $ entity_var_singular; ?> );
90
90
$form->handleRequest($request);
91
91
92
- $deleteForm = $this->createDeleteForm($<?= $ entity_var_singular ?> );
92
+ $deleteForm = $this->createDeleteForm($<?= $ entity_var_singular; ?> );
93
93
94
94
if ($form->isSubmitted() && $form->isValid()) {
95
95
$this->getDoctrine()->getManager()->flush();
96
96
97
- return $this->redirectToRoute('<?= $ route_name ?> _edit', ['<?= $ entity_identifier ?> ' => $<?= $ entity_var_singular ?> ->get<?= ucfirst ($ entity_identifier ) ?> ()]);
97
+ return $this->redirectToRoute('<?= $ route_name; ?> _edit', ['<?= $ entity_identifier; ?> ' => $<?= $ entity_var_singular; ?> ->get<?= ucfirst ($ entity_identifier ); ?> ()]);
98
98
}
99
99
100
- return $this->render('<?= $ route_name ?> /edit.html.twig', [
101
- '<?= $ entity_var_singular ?> ' => $<?= $ entity_var_singular ?> ,
100
+ return $this->render('<?= $ route_name; ?> /edit.html.twig', [
101
+ '<?= $ entity_var_singular; ?> ' => $<?= $ entity_var_singular; ?> ,
102
102
'form' => $form->createView(),
103
103
'delete_form' => $deleteForm->createView(),
104
104
]);
105
105
}
106
106
107
107
/**
108
- * @Route("/{<?= $ entity_identifier ?> }", name="delete")
108
+ * @Route("/{<?= $ entity_identifier; ?> }", name="delete")
109
109
* @Method("DELETE")
110
110
*
111
111
* @param Request $request
112
- * @param <?= $ entity_class_name ?> $<?= $ entity_var_singular ?> The <?= $ entity_class_name ?> entity
112
+ * @param <?= $ entity_class_name; ?> $<?= $ entity_var_singular; ?> The <?= $ entity_class_name; ?> entity
113
113
*
114
114
* @return Response
115
115
*/
116
- public function delete(Request $request, <?= $ entity_class_name ?> $<?= $ entity_var_singular ?> )
116
+ public function delete(Request $request, <?= $ entity_class_name; ?> $<?= $ entity_var_singular; ?> )
117
117
{
118
- $form = $this->createDeleteForm($<?= $ entity_var_singular ?> );
118
+ $form = $this->createDeleteForm($<?= $ entity_var_singular; ?> );
119
119
$form->handleRequest($request);
120
120
121
121
if ($form->isSubmitted() && $form->isValid()) {
122
122
$em = $this->getDoctrine()->getManager();
123
- $em->remove($<?= $ entity_var_singular ?> );
123
+ $em->remove($<?= $ entity_var_singular; ?> );
124
124
$em->flush();
125
125
}
126
126
127
- return $this->redirectToRoute('<?= $ route_name ?> _index');
127
+ return $this->redirectToRoute('<?= $ route_name; ?> _index');
128
128
}
129
129
130
130
/**
131
- * Creates a form to delete a <?= $ entity_class_name ?> entity.
131
+ * Creates a form to delete a <?= $ entity_class_name; ?> entity.
132
132
*
133
- * @param <?= $ entity_class_name ?> $<?= $ entity_var_singular ?> The <?= $ entity_class_name ?> entity
133
+ * @param <?= $ entity_class_name; ?> $<?= $ entity_var_singular; ?> The <?= $ entity_class_name; ?> entity
134
134
*
135
135
* @return \Symfony\Component\Form\FormInterface The form
136
136
*/
137
- private function createDeleteForm(<?= $ entity_class_name ?> $<?= $ entity_var_singular ?> )
137
+ private function createDeleteForm(<?= $ entity_class_name; ?> $<?= $ entity_var_singular; ?> )
138
138
{
139
139
return $this->createFormBuilder()
140
- ->setAction($this->generateUrl('<?= $ route_name ?> _delete', ['<?= $ entity_identifier ?> ' => $<?= $ entity_var_singular ?> ->get<?= ucfirst ($ entity_identifier ) ?> ()]))
140
+ ->setAction($this->generateUrl('<?= $ route_name; ?> _delete', ['<?= $ entity_identifier; ?> ' => $<?= $ entity_var_singular; ?> ->get<?= ucfirst ($ entity_identifier ); ?> ()]))
141
141
->setMethod('DELETE')
142
142
->getForm()
143
143
;
0 commit comments