Skip to content

Commit 0ebb463

Browse files
committed
Fix templates path include for CRUD Maker
1 parent 09c8625 commit 0ebb463

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

src/Maker/MakeCrud.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
193193
'entity_twig_var_singular' => $entityTwigVarSingular,
194194
'entity_identifier' => $entityDoctrineDetails->getIdentifier(),
195195
'route_name' => $routeName,
196+
'templates_path' => $templatesPath,
196197
],
197198
'index' => [
198199
'entity_class_name' => $entityClassDetails->getShortName(),
@@ -205,13 +206,15 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
205206
'new' => [
206207
'entity_class_name' => $entityClassDetails->getShortName(),
207208
'route_name' => $routeName,
209+
'templates_path' => $templatesPath,
208210
],
209211
'show' => [
210212
'entity_class_name' => $entityClassDetails->getShortName(),
211213
'entity_twig_var_singular' => $entityTwigVarSingular,
212214
'entity_identifier' => $entityDoctrineDetails->getIdentifier(),
213215
'entity_fields' => $entityDoctrineDetails->getDisplayFields(),
214216
'route_name' => $routeName,
217+
'templates_path' => $templatesPath,
215218
],
216219
];
217220

src/Resources/skeleton/crud/templates/edit.tpl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
{% block body %}
44
<h1>Edit <?= $entity_class_name ?></h1>
55

6-
{{ include('<?= $route_name ?>/_form.html.twig', {'button_label': 'Update'}) }}
6+
{{ include('<?= $templates_path ?>/_form.html.twig', {'button_label': 'Update'}) }}
77

88
<a href="{{ path('<?= $route_name ?>_index') }}">back to list</a>
99

10-
{{ include('<?= $route_name ?>/_delete_form.html.twig') }}
10+
{{ include('<?= $templates_path ?>/_delete_form.html.twig') }}
1111
{% endblock %}

src/Resources/skeleton/crud/templates/new.tpl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% block body %}
44
<h1>Create new <?= $entity_class_name ?></h1>
55

6-
{{ include('<?= $route_name ?>/_form.html.twig') }}
6+
{{ include('<?= $templates_path ?>/_form.html.twig') }}
77

88
<a href="{{ path('<?= $route_name ?>_index') }}">back to list</a>
99
{% endblock %}

src/Resources/skeleton/crud/templates/show.tpl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818

1919
<a href="{{ path('<?= $route_name ?>_edit', {'<?= $entity_identifier ?>': <?= $entity_twig_var_singular ?>.<?= $entity_identifier ?>}) }}">edit</a>
2020

21-
{{ include('<?= $route_name ?>/_delete_form.html.twig') }}
21+
{{ include('<?= $templates_path ?>/_delete_form.html.twig') }}
2222
{% endblock %}

0 commit comments

Comments
 (0)