Skip to content

Commit f77a843

Browse files
author
Thibaut Salanon
committed
Rename template_var with templates_path (plural)
1 parent 86d24f3 commit f77a843

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Maker/MakeCrud.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
138138
'form_class_name' => $formClassDetails->getShortName(),
139139
'route_path' => Str::asRoutePath($controllerClassDetails->getRelativeNameWithoutSuffix()),
140140
'route_name' => $routeName,
141-
'template_path' => $templatesPath,
141+
'templates_path' => $templatesPath,
142142
'entity_var_plural' => $entityVarPlural,
143143
'entity_twig_var_plural' => $entityTwigVarPlural,
144144
'entity_var_singular' => $entityVarSingular,

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class <?= $class_name ?> extends <?= $parent_class_name; ?><?= "\n" ?>
2323
<?php if (isset($repository_full_class_name)): ?>
2424
public function index(<?= $repository_class_name ?> $<?= $repository_var ?>): Response
2525
{
26-
return $this->render('<?= $template_path ?>/index.html.twig', ['<?= $entity_twig_var_plural ?>' => $<?= $repository_var ?>->findAll()]);
26+
return $this->render('<?= $templates_path ?>/index.html.twig', ['<?= $entity_twig_var_plural ?>' => $<?= $repository_var ?>->findAll()]);
2727
}
2828
<?php else: ?>
2929
public function index(): Response
@@ -32,7 +32,7 @@ public function index(): Response
3232
->getRepository(<?= $entity_class_name ?>::class)
3333
->findAll();
3434

35-
return $this->render('<?= $template_path ?>/index.html.twig', ['<?= $entity_twig_var_plural ?>' => $<?= $entity_var_plural ?>]);
35+
return $this->render('<?= $templates_path ?>/index.html.twig', ['<?= $entity_twig_var_plural ?>' => $<?= $entity_var_plural ?>]);
3636
}
3737
<?php endif ?>
3838

@@ -53,7 +53,7 @@ public function new(Request $request): Response
5353
return $this->redirectToRoute('<?= $route_name ?>_index');
5454
}
5555

56-
return $this->render('<?= $template_path ?>/new.html.twig', [
56+
return $this->render('<?= $templates_path ?>/new.html.twig', [
5757
'<?= $entity_twig_var_singular ?>' => $<?= $entity_var_singular ?>,
5858
'form' => $form->createView(),
5959
]);
@@ -64,7 +64,7 @@ public function new(Request $request): Response
6464
*/
6565
public function show(<?= $entity_class_name ?> $<?= $entity_var_singular ?>): Response
6666
{
67-
return $this->render('<?= $template_path ?>/show.html.twig', ['<?= $entity_twig_var_singular ?>' => $<?= $entity_var_singular ?>]);
67+
return $this->render('<?= $templates_path ?>/show.html.twig', ['<?= $entity_twig_var_singular ?>' => $<?= $entity_var_singular ?>]);
6868
}
6969

7070
/**
@@ -81,7 +81,7 @@ public function edit(Request $request, <?= $entity_class_name ?> $<?= $entity_va
8181
return $this->redirectToRoute('<?= $route_name ?>_edit', ['<?= $entity_identifier ?>' => $<?= $entity_var_singular ?>->get<?= ucfirst($entity_identifier) ?>()]);
8282
}
8383

84-
return $this->render('<?= $template_path ?>/edit.html.twig', [
84+
return $this->render('<?= $templates_path ?>/edit.html.twig', [
8585
'<?= $entity_twig_var_singular ?>' => $<?= $entity_var_singular ?>,
8686
'form' => $form->createView(),
8787
]);

0 commit comments

Comments
 (0)