Skip to content

Commit 06c1c49

Browse files
committed
Fix templates path include for CRUD Maker
1 parent d01a475 commit 06c1c49

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
@@ -191,6 +191,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
191191
'entity_twig_var_singular' => $entityTwigVarSingular,
192192
'entity_identifier' => $entityDoctrineDetails->getIdentifier(),
193193
'route_name' => $routeName,
194+
'templates_path' => $templatesPath,
194195
],
195196
'index' => [
196197
'entity_class_name' => $entityClassDetails->getShortName(),
@@ -203,13 +204,15 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
203204
'new' => [
204205
'entity_class_name' => $entityClassDetails->getShortName(),
205206
'route_name' => $routeName,
207+
'templates_path' => $templatesPath,
206208
],
207209
'show' => [
208210
'entity_class_name' => $entityClassDetails->getShortName(),
209211
'entity_twig_var_singular' => $entityTwigVarSingular,
210212
'entity_identifier' => $entityDoctrineDetails->getIdentifier(),
211213
'entity_fields' => $entityDoctrineDetails->getDisplayFields(),
212214
'route_name' => $routeName,
215+
'templates_path' => $templatesPath,
213216
],
214217
];
215218

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)