Skip to content

Commit 45ecdf1

Browse files
fix(controller): fix template path generator
1 parent b0aa109 commit 45ecdf1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Command/MakeTwcController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,10 @@ class: $namespaceContext,
120120
// so we don't end up with templates/app/my/controller.html.twig
121121
$templateName = $this->controllerClassData->getFullClassName(withoutRootNamespace: true, withoutSuffix: true);
122122

123-
$dir = $this->contextGenerator->getDirTemplateByContext('template', $context);
123+
124+
$path = str_replace('controller/','',Str::asFilePath($templateName));
124125
// Convert the twig template name into a file path where it will be generated.
125-
$this->twigTemplatePath = \sprintf('%s%s', $dir, $this->isInvokable ? '.html.twig' : '/index.html.twig');
126+
$this->twigTemplatePath = \sprintf('%s%s', $path, $this->isInvokable ? '.html.twig' : '/index.html.twig');
126127

127128
$this->interactSetGenerateTests($input, $io);
128129
}

0 commit comments

Comments
 (0)