I\'ve already read How does Symfony2 detect where to load templates from? and another ton of articles on the web
The question was quite similar to mine, but the answ
The class responsible for loading twig templates is stored at the service id twig.loader
, which by default is an instance of Symfony\Bundle\TwigBundle\Loader\FilesystemLoader
, and the class for locating templates is stored at the service id templating.locator
and by default is an instance of the class Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator
(which itself is injected as the first parameter to twig.loader
)
So, in theory, all you would need to do is write your own class that implements Symfony\Component\Config\FileLocatorInterface
(or extends Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator
) and then inform the configuration to use your class (which I was going to look up how to do this for you, but Symfony's websites are down right now)