Skip to content

Commit

Permalink
Rename template_var with templates_path (plural)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibaut Salanon committed Oct 10, 2018
1 parent 86d24f3 commit f77a843
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Maker/MakeCrud.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
'form_class_name' => $formClassDetails->getShortName(),
'route_path' => Str::asRoutePath($controllerClassDetails->getRelativeNameWithoutSuffix()),
'route_name' => $routeName,
'template_path' => $templatesPath,
'templates_path' => $templatesPath,
'entity_var_plural' => $entityVarPlural,
'entity_twig_var_plural' => $entityTwigVarPlural,
'entity_var_singular' => $entityVarSingular,
Expand Down
10 changes: 5 additions & 5 deletions src/Resources/skeleton/crud/controller/Controller.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class <?= $class_name ?> extends <?= $parent_class_name; ?><?= "\n" ?>
<?php if (isset($repository_full_class_name)): ?>
public function index(<?= $repository_class_name ?> $<?= $repository_var ?>): Response
{
return $this->render('<?= $template_path ?>/index.html.twig', ['<?= $entity_twig_var_plural ?>' => $<?= $repository_var ?>->findAll()]);
return $this->render('<?= $templates_path ?>/index.html.twig', ['<?= $entity_twig_var_plural ?>' => $<?= $repository_var ?>->findAll()]);
}
<?php else: ?>
public function index(): Response
Expand All @@ -32,7 +32,7 @@ public function index(): Response
->getRepository(<?= $entity_class_name ?>::class)
->findAll();

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

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

return $this->render('<?= $template_path ?>/new.html.twig', [
return $this->render('<?= $templates_path ?>/new.html.twig', [
'<?= $entity_twig_var_singular ?>' => $<?= $entity_var_singular ?>,
'form' => $form->createView(),
]);
Expand All @@ -64,7 +64,7 @@ public function new(Request $request): Response
*/
public function show(<?= $entity_class_name ?> $<?= $entity_var_singular ?>): Response
{
return $this->render('<?= $template_path ?>/show.html.twig', ['<?= $entity_twig_var_singular ?>' => $<?= $entity_var_singular ?>]);
return $this->render('<?= $templates_path ?>/show.html.twig', ['<?= $entity_twig_var_singular ?>' => $<?= $entity_var_singular ?>]);
}

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

return $this->render('<?= $template_path ?>/edit.html.twig', [
return $this->render('<?= $templates_path ?>/edit.html.twig', [
'<?= $entity_twig_var_singular ?>' => $<?= $entity_var_singular ?>,
'form' => $form->createView(),
]);
Expand Down

0 comments on commit f77a843

Please sign in to comment.