Skip to content

Commit b797729

Browse files
committed
Possibility to add custom templates when [make] command
1 parent 881ecf0 commit b797729

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Generator.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,11 @@ public function generateController(string $controllerClassName, string $controll
264264
*/
265265
public function generateTemplate(string $targetPath, string $templateName, array $variables = [])
266266
{
267+
$templatePath = 'templates/bundles/MakerBundle/' . $templateName;
268+
if ($this->fileManager->fileExists($templatePath)) {
269+
$templateName = $templatePath;
270+
}
271+
267272
$this->generateFile(
268273
$this->fileManager->getPathForTemplate($targetPath),
269274
$templateName,

0 commit comments

Comments
 (0)