-
-
Notifications
You must be signed in to change notification settings - Fork 436
Open
Description
If the absolute path to the template is not passed to the Generator class, it defaults to looking in makerBundle's skeleton directory.
if (!file_exists($templatePath)) {
$templatePath = __DIR__.'/Resources/skeleton/'.$templateName;
What I'd like to do is set a list of paths to use when looking for a template in the config, e.g.
maker:
root_namespace: Foo
template_dirs:
- my/templates
- vendor/symfony/maker-bundle/src/Resources/skeleton/twig
This would also allow my own makers to not require hardcoding the path or overriding the generator class. That is, if I have a make:something (MakeSomething.php), I'd like to be able to call
$generator->generateClass(
$extensionClassNameDetails->getFullName(),
'Something.tpl.php',
['use_statements' => $useStatements]
);
without having to prefix the template path myself with DIR . '../../skeleton/'.
Happy to do the PR if this approach seems worthwhile. I love the maker bundle, and use my own makers all the time.
JordiDekker, balzacLeGeek, rudak, twispr, labudzinski and 4 more
Metadata
Metadata
Assignees
Labels
No labels