is it possible to put the template of a component in an other folder then the template folder in Symfony

StackOverflow https://stackoverflow.com/questions/1027840

Question

I have a component that calls a template from the template folder as it should be done. But as there are a lot of files in the template folder i would rather have them split up in different sub folders. Is it possible to call a template in a specific folder for a component? And how is this done?

now i have public function executeTest(){} that automatically calls the template _Test.php in the template folder.

Is it possible and somehow create a subfolder in the template folder where this _Test.php file is located? Can you put some code in the executeTest(){} to get a template from that subfolder

thx in advance.

This is all to improve the overview of files and increase readability.

Was it helpful?

Solution

This is something I've been thinking of and wanting to do since I started using Symfony over a year ago. As far as I know, there is no simple way of doing this. I usually end up creating new modules or using some kind of naming scheme that makes the partials easier to find.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top