Skip to content

add customizable templates path#1710

Open
eltharin wants to merge 1 commit intosymfony:1.xfrom
eltharin:allow_param_for_templates_folders
Open

add customizable templates path#1710
eltharin wants to merge 1 commit intosymfony:1.xfrom
eltharin:allow_param_for_templates_folders

Conversation

@eltharin
Copy link
Copy Markdown
Contributor

@eltharin eltharin commented Jun 12, 2025

allow user to customize their templates by adding a config parameter to list templates folders.
generator will search in all folders listed in the configurations before to select its own template.
With that, user can modify one or more templates to get what he want without copy all maker classes :).

If no config is made => nothing move, all stay as before,
config can be set in a bundle (and the templates can be there too) to maximize reusability.

by example config can be :

maker:
    templates_folders:
        - "makertemplates"
        - "vendor/eltharin/myBundle/makerTemplates

@eltharin eltharin force-pushed the allow_param_for_templates_folders branch from 11233a8 to 81b6132 Compare June 12, 2025 10:55
@pkly
Copy link
Copy Markdown

pkly commented Aug 29, 2025

Any chance this could be merged sometime? I'd also like to see this feature, and it'd resolve #1135

Copy link
Copy Markdown
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👎🏻 Making the template directory configurable means we have to maintain backward compatibility for filenames and the parameters passed to templates. This makes it much harder to make changes without breaking your usage. I am therefore opposed to this change.

@pkly
Copy link
Copy Markdown

pkly commented Mar 19, 2026

Wouldn't it be better to simply... place the templates in the template directory, and have symfony resolve it like it does with twig? That way you wouldn't have to worry about backwards compatibility and anyone who'd like to override could simply do so using the built-in bundle override feature for templates

@eltharin
Copy link
Copy Markdown
Contributor Author

eltharin commented Apr 1, 2026

👎🏻 Making the template directory configurable means we have to maintain backward compatibility for filenames and the parameters passed to templates. This makes it much harder to make changes without breaking your usage. I am therefore opposed to this change.

Yes, this requires some procedures and avoids making random changes. Now, do the filenames change with each version? Isn't this a "Symfony" project, which is supposed to be a well-structured project? Your answer is surprising in this context.

@eltharin
Copy link
Copy Markdown
Contributor Author

eltharin commented Apr 1, 2026

The ability to extend templates is requested by a large majority of users; perhaps they should be listened to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants